共用方式為


CWindow::GetParent

擷取直接父視窗。

HWND GetParent( ) const throw();

備註

請參閱在 Windows SDK的 GetParent

範例

// The following example attaches a HWND to the CWindow object
// and calls CWindow::GetParent to find out the parent
// window of the window wrapped by CWindow object.

CWindow myWindow;
myWindow.Attach(hWnd);   
HWND hWndParent = myWindow.GetParent();

需求

Header: atlwin.h

請參閱

參考

CWindow 類別

CWindow::SetParent