name22

Process Get Windows

Jun 9th, 2012
141
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Array.au3>
  2. #include <Process.au3>
  3.  
  4. GUICreate("Test1", 100, 100)
  5. GUICreate("Test2", 100, 100)
  6. GUICreate("Test3", 100, 100)
  7. GUICreate("Test4", 100, 100)
  8. GUISetState()
  9.  
  10. $aResult = _ProcessGetWindows("Autoit3.exe")
  11. _ArrayDisplay($aResult)
  12.  
  13. Func _ProcessGetWindows($sProcessName)
  14.     $aWinList = WinList()
  15.     $sWindowsFound = ""
  16.     For $i = 1 To $aWinList[0][0]
  17.         If _ProcessGetName(WinGetProcess($aWinList[$i][0])) = $sProcessName And $aWinList[$i][0] <> "" Then $sWindowsFound &= $aWinList[$i][0] & '|'
  18.     Next
  19.     If $sWindowsFound = "" Then Return -1
  20.     Return StringSplit(StringTrimRight($sWindowsFound, 1), "|", 2)
  21. EndFunc   ;==>_ProcessGetWindows
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×