Udostępnij za pośrednictwem


CWnd::GetParentOwner

Call this member function to get a pointer to a child window's parent window or owner window.

CWnd* GetParentOwner( ) const;

Return Value

A pointer to a CWnd object. If a CWnd object is not attached to the handle, a temporary CWnd object is created and attached. The pointer may be temporary and should not be stored for later use.

Remarks

GetParentOwner returns a pointer to the most immediate parent or owner window that is not a child window (does not have the WS_CHILD style). The current owner window can be set with SetOwner. By default, the parent of a window is its owner.

In contrast, the GetParent function returns a pointer to the immediate parent, whether it is a child window or not. If you have a child window within a child window GetParent and GetParentOwner return different results.

Requirements

Header: afxwin.h

See Also

Concepts

CWnd Members

Reference

CWnd Class

Hierarchy Chart

CWnd::GetParent

CWnd::GetOwner

CWnd::SetOwner

CWnd::SetParent

GetParent