共用方式為


CWindow::Detach

中斷連結 CWindow 物件的 m_hWnd 並設定 m_hWndNULL

HWND Detach( ) throw();

傳回值

HWNDCWindow 物件。

範例

//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

請參閱

參考

CWindow 類別

CWindow::Attach