CWnd::GetSafeOwner

CWnd* PASCAL GetSafeOwner( CWnd* pParent**, HWND*** pWndTop );

Return Value

A pointer to the safe owner for the given window.

Parameters

pParent

A pointer to a parent CWnd window.

pWndTop

A pointer to the window that is currently on top. May be NULL.

Remarks

Call this member function to retrieve the owner window that should be used for dialog boxes or other modal windows. The safe owner is the first non-child parent window of pParentWnd. If pParentWnd is NULL, the thread’s main window (retrieved via AfxGetMainWnd) is used to find an owner.

Note   The framework itself uses this function to determine the correct owner window for dialog boxes and property sheets where the owner is not specified.

CWnd OverviewClass MembersHierarchy Chart

See Also   AfxGetMainWnd