Skip to content

Latest commit

 

History

History
139 lines (110 loc) · 3.38 KB

nf-winuser-getancestor.md

File metadata and controls

139 lines (110 loc) · 3.38 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name req.apiset
NF:winuser.GetAncestor
GetAncestor function (winuser.h)
Retrieves the handle to the ancestor of the specified window.
GA_PARENT
GA_ROOT
GA_ROOTOWNER
GetAncestor
GetAncestor function [Windows and Messages]
_win32_GetAncestor
_win32_getancestor_cpp
winmsg.getancestor
winui._win32_getancestor
winuser/GetAncestor
winmsg\getancestor.htm
winmsg
VS|winui|~\winui\windowsuserinterface\windowing\windows\windowreference\windowfunctions\getancestor.htm
12/05/2018
GA_PARENT, GA_ROOT, GA_ROOTOWNER, GetAncestor, GetAncestor function [Windows and Messages], _win32_GetAncestor, _win32_getancestor_cpp, winmsg.getancestor, winui._win32_getancestor, winuser/GetAncestor
winuser.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
User32.lib
User32.dll
Windows
19H1
GetAncestor
winuser/GetAncestor
c++
APIRef
kbSyntax
DllExport
User32.dll
API-MS-Win-NTUser-IE-Window-l1-1-0.dll
ie_shims.dll
API-MS-Win-RTCore-NTUser-Window-l1-1-0.dll
minuser.dll
Ext-MS-Win-NTUser-Window-l1-1-1.dll
Ext-MS-Win-NTUser-Window-l1-1-2.dll
Ext-MS-Win-RTCore-NTUser-Window-Ext-l1-1-0.dll
ext-ms-win-ntuser-window-l1-1-3.dll
Ext-MS-Win-NTUser-Window-L1-1-4.dll
GetAncestor
ext-ms-win-ntuser-window-l1-1-1 (introduced in Windows 8.1)

GetAncestor function

-description

Retrieves the handle to the ancestor of the specified window.

-parameters

-param hwnd [in]

Type: HWND

A handle to the window whose ancestor is to be retrieved. If this parameter is the desktop window, the function returns NULL.

-param gaFlags [in]

Type: UINT

The ancestor to be retrieved. This parameter can be one of the following values.

Value Meaning
GA_PARENT
1
Retrieves the parent window. This does not include the owner, as it does with the GetParent function.
GA_ROOT
2
Retrieves the root window by walking the chain of parent windows.
GA_ROOTOWNER
3
Retrieves the owned root window by walking the chain of parent and owner windows returned by GetParent.

-returns

Type: HWND

The return value is the handle to the ancestor window.

-see-also

Conceptual

GetParent

Reference

Windows