BOOL DestroyWindow( );
See DestroyWindow in the Win32 SDK.
Remarks
Destroys the window associated with the CWindow object and sets m_hWnd to NULL. It does not destroy the CWindow object itself.
Example
//The following example attaches an HWND to the CWindow object and
//calls CWindow::DestroyWindow() to destroy the window
CWindow fooWindow;
fooWindow.Attach(hWndChild);
//call the CWindow wrappers
...
...
...
fooWindow.DestroyWindow();
hWndChild = NULL;