Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.51 KB | None | 0 0
  1. Func _WinGetByPID($iPID, $nArray = 1)
  2.     If IsString($iPID) Then $iPID = ProcessExists($iPID)
  3.     Local $aWList = WinList(), $sHold
  4.     For $iCC = 1 To $aWList[0][0]
  5.         If WinGetProcess($aWList[$iCC][1]) = $iPID And _
  6.             BitAND(WinGetState($aWList[$iCC][1]), 2) Then
  7.             If $nArray Then Return $aWList[$iCC][0]
  8.             $sHold &= $aWList[$iCC][0] & Chr(1)
  9.         EndIf
  10.     Next
  11.     If $sHold Then Return StringSplit(StringTrimRight($sHold, 1), Chr(1))
  12.     Return SetError(1, 0, 0)
  13. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement