|
Subclassing is the term for replacing the WndProc of a window
with a different WndProc and calling the old WndProc for default (superclass)
functionality. A CWnd object gets attached to an existing window and you
can modify the behavior in a derived class. This is called dynamic subclassing,
since the behavior (and hence the class) of an object is changed at run time.
Dynamic subclassing is done with either of the CWnd member functions:
CWnd::SubclassWindow()
CWnd::SubclassDlgItem()
These routines attach a CWnd object to an existing window. SubclassWindow()
takes the window handle directly, and SubclassDlgItem() is a helper that
takes a control ID and the parent window (usually a dialog). SubclassDlgItem()
is designed for attaching C++ objects to dialog controls created from a dialog
template.
|