Author Topic: NullDC  (Read 3197 times)

mgalaxy

  • Administrator
  • Hero Member
  • *****
  • Posts: 760
    • Email
NullDC
« on: August 25, 2013, 09:33:00 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. local $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=34
« Last Edit: August 25, 2013, 03:58:44 PM by mgalaxy »