UDF > WinAPIEx > System > Windows >


_WinAPI_EnumWindowsTop

Énumère toutes les fenêtres de haut niveau

#include <WinAPISysWin.au3>
_WinAPI_EnumWindowsTop ( )

Valeur de retour

Retourne un tableau avec le format suivant:
    [0][0] - Nombre de lignes dans le tableau (n)
    [1][0] - Handle de la fenêtre 1
    [1][1] - Nom de la classe de la fenêtre 1
    ...
    [n][0] - Handle de la fenêtre n
    [n][1] - Nom de la classe de la fenêtre n

En relation

_WinAPI_EnumWindows, _WinAPI_EnumWindowsPopup

Exemple

#include <MsgBoxConstants.au3>
#include <WinAPISysWin.au3>

Example()

Func Example()
    Local $aWindows, $i, $sText
    $aWindows = _WinAPI_EnumWindowsTop()
    For $i = 1 To $aWindows[0][0]
        $sText = "Window Handle: " & $aWindows[$i][0] & @CRLF
        $sText &= "Window Class: " & $aWindows[$i][1] & @CRLF
        $sText &= "Window Title: " & WinGetTitle($aWindows[$i][0]) & @CRLF
        $sText &= "Window Text: " & WinGetText($aWindows[$i][0]) & @CRLF
        $sText &= "Window Process: " & WinGetProcess($aWindows[$i][0])
        MsgBox($MB_SYSTEMMODAL, "Item " & $i & " de " & $aWindows[0][0], $sText)
    Next
EndFunc   ;==>Example