Understanding the Message-Handling System

From RAD Studio
Jump to: navigation, search

Go Up to Using the Windows API Messaging Solution

All VCL classes have a built-in mechanism for handling messages, called message-handling methods or message handlers. The basic idea of message handlers is that the class receives messages of some sort and dispatches them, calling one of a set of specified methods depending on the message received. If no specific method exists for a particular message, there is a default handler.

The following diagram shows the message-dispatch system:


The Visual Component Library defines a message-dispatching system that translates all Windows messages (including user-defined messages) directed to a particular class into method calls. You should never need to alter this message-dispatch mechanism. All you will need to do is create message-handling methods. See the section Declaring a New Message-handling Method for more on this subject.