Author Topic: PCSX2  (Read 3337 times)

mgalaxy

  • Administrator
  • Hero Member
  • *****
  • Posts: 754
    • Email
PCSX2
« on: August 25, 2013, 09:33:21 AM »
Source code

Code: AutoIt
  1. ;Parsing
  2. Local $count = StringInStr($CmdLineRaw, ".exe", 0 , 1, 1)
  3. local $app = StringLeft ( $CmdLineRaw, $count + 4 )
  4. local $command = StringTrimLeft( $CmdLineRaw, $count + 4 )
  5. if not $command then exit 0
  6.    
  7. HotKeySet("{ESC}", "Terminate")
  8.  
  9. $PID = Run ('"' & $app & '" ' & $command)
  10.  
  11. while _WinWaitActivePID($PID)
  12.    sleep(500)
  13.  
  14.    sleep(500)
  15.  
  16.  
  17. ;functions
  18. Func Terminate()
  19.     While ProcessExists ( $PID )
  20.           ProcessClose ( $PID )
  21.     WEnd
  22.     Exit 0
  23.  
  24.  Func _WinWaitActivePID($iPid)
  25.     While 1
  26.         Local $list = WinList()
  27.         For $i = 1 To $list[0][0]
  28.             If $list[$i][0] <> "" And IsVisible($list[$i][1]) Then
  29.                 If WinGetProcess($list[$i][1]) = $iPid AND WinActive($list[$i][1]) Then Return $list[$i][0]
  30.             EndIf
  31.         Next
  32.     WEnd
  33.  
  34. Func IsVisible($handle)
  35.     If BitAND(WinGetState($handle), 2) Then
  36.         Return 1
  37.     Else
  38.         Return 0
  39.     EndIf

Executable

http://www.mgalaxy.com/forum/index.php?action=downloads;sa=view;down=35
« Last Edit: August 25, 2013, 03:58:02 PM by mgalaxy »