RAD Studio |  |

Declaring a Message-structure Type

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 message's parameters, 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:

1. Name the record type after the message, preceded by a T.
2. Call the first field in the record Msg, of type TMsgParam.
3. 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.
4. Add a final field called Result, of type Longint.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!