共用方式為


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

Reference

CWindow Class

CWindow::Detach

Other Resources

CWindow Members