共用方式為


CWindow::SetParent

變更父視窗。

HWND SetParent(
   HWND hWndNewParent 
) throw();

備註

請參閱在 Windows SDK的 SetParent

範例

// The following example attaches a HWND to the CWindow object
// and sets the hWndParent as the parent window of the 
// window wrapped by CWindow object using CWindow::SetParent.

CWindow myWindow;
myWindow.Attach(hWndChild);
HWND hWndPrevParent = myWindow.SetParent(hWndParent);

需求

Header: atlwin.h

請參閱

參考

CWindow 類別

CWindow::GetParent