RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCommonDialog.MessageHook Method

Provides special Windows message processing for the dialog.

Pascal
function MessageHook(var Msg: TMessage): Boolean; virtual;
C++
virtual __fastcall Boolean MessageHook(TMessage Msg);

MessageHook intercepts messages sent to the dialog window before the dialog's window procedure gets them. When MessageHook handles a message, it returns true to indicate that the message should not be sent on for further processing. If the window procedure should handle the message, MessageHook returns false. 

Override MessageHook to provide extra message processing. For example, if the Template property substitutes a dialog template with additional controls, use MessageHook to handle messages from those dialog controls. 

In TCommonDialog, MessageHook handles Help messages by calling the application's HelpContext method if the HelpContext property is defined. Descendants of TCommonDialog override MessageHook to add additional message processing. 

 

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