Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


Retrieves a pointer to the owner of the window.

CWnd* GetOwner( ) const;

Return Value

A pointer to a CWnd object.


If the window has no owner, then a pointer to the parent window object is returned by default. Note that the relationship between the owner and the owned differs from the parent-child aspect in several important aspects. For example, a window with a parent is confined to its parent window's client area. Owned windows can be drawn at any location on the desktop.

The ownership concept of this function is different from the ownership concept of GetWindow.

See Also

CWnd Overview | Class Members | Hierarchy Chart | CWnd::GetParent | CWnd::SetOwner

© 2015 Microsoft