The GetAncestor function retrieves the handle to the ancestor of the specified window.
Declare Function GetAncestor Lib "user32.dll" (ByVal hwnd As Long, ByVal gaFlags As Long) As Long
|Operating Systems Supported|
|Requires Windows NT 4.0 SP4 or later; Requires Windows 98|
[in] Handle to the window whose ancestor is to be retrieved. If this parameter is the desktop window, the function returns NULL.
[in] Specifies the ancestor to be retrieved. This parameter can be one of the following values.
Retrieves the parent window. This does not include the owner, as it does with the GetParent function.
Retrieves the root window by walking the chain of parent windows.
Retrieves the owned root window by walking the chain of parent and owner windows returned by GetParent.
|The return value is the handle to the ancestor window.|