Share via


CWnd::SubclassWindow

BOOLSubclassWindow(HWNDhWnd**);**

Return Value

Nonzero if the function is successful; otherwise 0.

Parameters

hWnd

A handle to the window.

Remarks

Call this member function to "dynamically subclass" a window and attach it to this CWnd object. When a window is dynamically subclassed, windows messages will route through the CWnd’s message map and call message handlers in the CWnd’s class first. Messages that are passed to the base class will be passed to the default message handler in the window.

This member function attaches the Windows control to a CWnd object and replaces the window’s WndProc and AfxWndProc functions. The function stores a pointer to the old WndProc in the CWnd object.

CWnd OverviewClass MembersHierarchy Chart

See Also   CWnd::GetSuperWndProcAddr, CWnd::DefWindowProc, CWnd::SubclassDlgItem, CWnd::Attach, CWnd::PreSubclassWindow, CWnd::UnsubclassWindow