Declaring a Message-structure Type
Go Up to Defining Your Own Messages
If you want to give useful names to the parameters of your message, you need to declare a message-record type for that message. The message-record is the type of the parameter passed to the message-handling method. If you do not use the parameters of the message, or if you want to use the old-style parameter notation (wParam, lParam, and so on), you can use the default message-record, TMessage.
To declare a message-record type, follow these conventions:
- Name the record type after the message, preceded by a T.
- Call the first field in the record Msg, of type TMsgParam.
- Define the next two bytes to correspond to the Word parameter, and the next two bytes as unused. Or Define the next four bytes to correspond to the Longint parameter.
- Add a final field called Result, of type Longint.