共用方式為


CWindow::Attach

附加 hWndNew 判斷的 Windows CWindow 物件。

void Attach(
   HWND hWndNew 
) throw();

參數

  • hWndNew
    視窗的控制代碼。

範例

//The following example attaches an HWND to the CWindow object
HWND hWnd  = ::GetDesktopWindow();
CWindow myWindow;
myWindow.Attach(hWnd);

需求

Header: atlwin.h

請參閱

參考

CWindow 類別

CWindow::Detach