# Function Reference

# _WinAPI_EnumWindowsPopup

Enumerates popup windows

#include <WinAPISysWin.au3>
_WinAPI_EnumWindowsPopup ( )

## Return Value

Returns an array with the following format:
[0][0] - Number of rows in array (n)
[1][0] - Window handle
[1][1] - Window class name
[n][0] - Window handle
[n][1] - Window class name

## Related

_WinAPI_EnumWindows, _WinAPI_EnumWindowsTop

## Example

    #include <Array.au3>
    #include <WinAPISysWin.au3>

    ToolTip("test Popup") ; to have at least one popup window

    Example()

    Func Example()
        Local $aWindows = _WinAPI_EnumWindowsPopup()

        Local $aResult[$aWindows[0][0] + 1][5]
        For $i = 1 To $aWindows[0][0]
            $aResult[$i][0] = WinGetProcess($aWindows[$i][0])
            $aResult[$i][1] = $aWindows[$i][0]
            $aResult[$i][2] = $aWindows[$i][1]
            $aResult[$i][3] = WinGetTitle($aWindows[$i][0])
            $aResult[$i][4] = ExtractFirstNonBlankLine(WinGetText($aWindows[$i][0]))
        Next
        _ArraySort($aResult)
        _ArrayDisplay($aResult, "_WinAPI_EnumWindowsPopup() - v" & @AutoItVersion, "1:", Default, Default, "Process ID|Handle|Windows Class                                               |Windows Title                                                         |Windows Text ")
    EndFunc   ;==>Example

    Func ExtractFirstNonBlankLine($sText)
        Local $aText = StringSplit($sText, @LF)

        For $i = 1 To $aText[0]
            If $aText[$i] Then Return $aText[$i]
        Next

        Return ""
    EndFunc   ;==>ExtractFirstNonBlankLine