Obtient le handle de la fen�tre anc�tre d'une fen�tre sp�cifi�e
#include <WinAPISysWin.au3>
_WinAPI_GetAncestor ( $hWnd [, $iFlags = 1] )
$hWnd | Handle de la fen�tre dont l'anc�tre est � r�cup�rer. Si c'est la fen�tre du bureau, la fonction retourne 0. |
$iFlags | [optionnel] Sp�cifie le parent � r�cup�rer. Ce param�tre peut prendre l'une des valeurs suivantes: $GA_PARENT - R�cup�re la fen�tre parent directe $GA_ROOT - R�cup�re la fen�tre racine en parcourant la cha�ne des fen�tres parents $GA_ROOTOWNER - R�cup�re la fen�tre racine propri�taire en parcourant la cha�ne des fen�tres parents et propri�taires retourn�e par GetParent. |
Les constantes ci-dessus sont d�finies dans WindowsConstants.au3
Consultez GetAncestor dans la librairie MSDN.
#include <MsgBoxConstants.au3> #include <WinAPISysWin.au3> #include <WindowsConstants.au3> Example() Func Example() Local $hWnd, $hParent $hWnd = GUICreate("test") $hParent = _WinAPI_GetAncestor($hWnd, $GA_PARENT) MsgBox($MB_SYSTEMMODAL, "Parent", "Get Ancestor of " & $hWnd & ": " & $hParent) MsgBox($MB_SYSTEMMODAL, "Root", "Get Ancestor of " & $hParent & ": " & _WinAPI_GetAncestor($hWnd, $GA_ROOT)) MsgBox($MB_SYSTEMMODAL, "Root Owner", "Get Ancestor of " & $hParent & ": " & _WinAPI_GetAncestor($hWnd, $GA_ROOTOWNER)) EndFunc ;==>Example