RAD Studio
ContentsIndex
PreviousUpNext
Declaring a New Message-handling Method

There are two sets of circumstances that require you to declare new message-handling methods:

  • Your component needs to handle a Windows message that is not already handled by the standard components.
  • You have defined your own message for use by your components.

To declare a message-handling method, do the following:

  1. Declare the method in a protected part of the component's class declaration.
  2. Make the method a procedure.
  3. Name the method after the message it handles, but without any underline characters.
  4. Pass a single var parameter called Message, of the type of the message record.
  5. Within the message method implementation, write code for any handling specific to the component.
  6. Call the inherited message handler.

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