Guest User

Untitled

a guest
Aug 13th, 2015
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. While 1
  2. $pList = ProcessList("League of Legends.exe")
  3.  
  4. For $i = 1 To $pList[0][0]
  5. WinActivate(HWnd(_GetHwndFromPID($pList[$i][1])))
  6. Sleep(2000)
  7. Next
  8.  
  9. ProcessClose("BsSndRpt.exe")
  10.  
  11. Sleep(10000)
  12. WEnd
  13.  
  14. Func _GetHwndFromPID($PID)
  15. $hWnd = 0
  16. $winlist = WinList()
  17. Do
  18. For $i = 1 To $winlist[0][0]
  19. If $winlist[$i][0] <> "" Then
  20. $iPID2 = WinGetProcess($winlist[$i][1])
  21. If $iPID2 = $PID Then
  22. $hWnd = $winlist[$i][1]
  23. ExitLoop
  24. EndIf
  25. EndIf
  26. Next
  27. Until $hWnd <> 0
  28. Return $hWnd
  29. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment