Anatomy of a Message System: VCL

There's much more to VCL's message system than handling messages with the message directive. After a message is issued by Windows, it makes a couple of stops before reaching your message-handling procedure (and it might make a few more stops afterward). All along the way, you have the power to act on the message.

For posted messages, the first stop for a Windows message in VCL is the Application.Process Message() method, which houses the VCL main message loop. The next stop for a message is the handler for the Application.OnMessage event. OnMessage is called as messages are fetched from the application queue in the ProcessMessage() method. Because sent messages aren't queued, OnMessage won't be called for sent ...

Get Borland® Delphi™ 6 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.