
Process Get Windows
By:
name22 on
Jun 9th, 2012 | syntax:
AutoIt | size: 0.65 KB | hits: 70 | expires: Never
#include <Array.au3>
#include <Process.au3>
GUICreate("Test1", 100, 100)
GUICreate("Test2", 100, 100)
GUICreate("Test3", 100, 100)
GUICreate("Test4", 100, 100)
GUISetState()
$aResult = _ProcessGetWindows("Autoit3.exe")
_ArrayDisplay($aResult)
Func _ProcessGetWindows($sProcessName)
$aWinList = WinList()
$sWindowsFound = ""
For $i = 1 To $aWinList[0][0]
If _ProcessGetName(WinGetProcess($aWinList[$i][0])) = $sProcessName And $aWinList[$i][0] <> "" Then $sWindowsFound &= $aWinList[$i][0] & '|'
Next
If $sWindowsFound = "" Then Return -1
Return StringSplit(StringTrimRight($sWindowsFound, 1), "|", 2)
EndFunc ;==>_ProcessGetWindows