RAD Studio VCL Reference
TWinControl.DefWndProc Property

Specifies the default window procedure for the windowed control.

property DefWndProc: Pointer;
__property void * DefWndProc;

Windowed controls use the Windows API function CallWindowProc with DefWndProc to invoke the standard Windows message handling for a window message. Using DefWndProc instead of the WndProc method bypasses any message processing introduced by the WndProc method. 

DefWndProc fills the role for windowed controls that DefaultHandler fills for all objects. The DefaultHandler for TWinControl uses DefWndProc to pass messages to Windows for processing. 

For windowed controls, DefWndProc is initially set to the window procedure of the window class specified in the Params parameter in the CreateParams method. Change DefWndProc to subclass the window class of a windowed control. 


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