Share via


CContainedWindowT::UnsubclassWindow

 

Detaches the subclassed window from the CContainedWindowT object and restores the original window procedure, saved in m_pfnSuperWindowProc.

Syntax

      HWND UnsubclassWindow(
   BOOL bForce = FALSE
);

Parameters

  • bForce
    [in] Set to TRUE to force the original window procedure to be restored even if the window procedure for this CContainedWindowT object is not currently active. If bForce is set to FALSE and the window procedure for this CContainedWindowT object is not currently active, the original window procedure will not be restored.

Return Value

The handle to the window previously subclassed. If bForce is set to FALSE and the window procedure for this CContainedWindowT object is not currently active, returns NULL.

Remarks

Use this method only if you want to restore the original window procedure before the window is destroyed. Otherwise, WindowProc will automatically do this when the window is destroyed.

Requirements

Header: atlwin.h

See Also

CContainedWindowT Class
CContainedWindowT::SubclassWindow