CWindow::Detach

HWND Detach( );

Return Value

The HWND associated with the CWindow object.

Remarks

Detaches m_hWnd from the CWindow object and sets m_hWnd to NULL.

Example

//The following example attaches an HWND to the CWindow object and 
//later detaches the CWindow object from the HWND when no longer needed

CWindow fooWindow;
fooWindow.Attach(hWndFoo);
//call CWindow wrappers
...
...
...

//We don't need the C++ object any more, so detach it from the HWND.
fooWindow.Detach(); 

CWindow OverviewClass Members

See Also   CWindow::Attach