RAD Studio VCL Reference
TWinControl.DefaultHandler Method

Provides message handling for all messages that the control does not fully process itself.

procedure DefaultHandler(var Message); override;
virtual __fastcall DefaultHandler( Message);

Override DefaultHandler to change the default message handling for the control. The Message parameter can be cast to a TMessage type, to obtain the WParam, LParam, and Result of the message. If the Result of the message is non-zero, the message has already been handled. Set the Result field to a non-zero value to prevent further processing of the message by the inherited method.

Note: In Delphi code, calling inherited in a message-handling method results in a call to the ancestor's DefaultHandler method unless that ancestor specifies an explicit handler for the message.
TWinControl overrides the TControl DefaultHandler method to handle messages for all its descendant types. DefaultHandler passes any otherwise-unhandled messages to the control's window procedure using the CallWindowProc API function. 


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