CWindow::Attach

 

Attaches the window identified by hWndNew to the CWindow object.

Syntax

      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

CWindow Class
CWindow::Detach