Using Message Parameters

From RAD Studio
Jump to: navigation, search

Go Up to Changing Message Handling

Once inside a message-handling method, your component has access to all the parameters of the message structure. Because the parameter passed to the message handler is a var parameter, the handler can change the values of the parameters if necessary. The only parameter that changes frequently is the Result field for the message: the value returned by the SendMessage call that sends the message.

Because the type of the Message parameter in the message-handling method varies with the message being handled, you should refer to the documentation on Windows messages for the names and meanings of individual parameters. If for some reason you need to refer to the message parameters by their old-style names (WParam, LParam, and so on), you can typecast Message to the generic type TMessage, which uses those parameter names.