CWindow::Detach
Наконец m_hWnd удаляет из объекта CWindow и задает m_hWnd к NULL.
HWND Detach( ) throw();
Возвращаемое значение
HWND, связанное с объектом CWindow.
Пример
//The following example attaches an HWND to the CWindow object and
//later detaches the CWindow object from the HWND when no longer needed
CWindow myWindow;
myWindow.Attach(hWnd);
//call CWindow wrappers
//We don't need the C++ object any more, so detach it from the HWND.
myWindow.Detach();
Требования
Header: atlwin.h