다음을 통해 공유


CWindow::Attach

Attaches the window identified by hWndNew to the CWindow object.

void Attach(
   HWND hWndNew 
) throw();

Parameters

  • hWndNew
    [in] The handle to a window.

Example

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

Requirements

Header: atlwin.h

See Also

Concepts

CWindow Class

CWindow Members

CWindow::Detach