Autoit soll Programm überprüfen?!

04/30/2013 13:54 golle12#1
Guten Tag Elitepvpers

und zwar möchte ich das Autoit ein Programm untersucht und schaut ob das Programm läuft und wenn nicht (zum Beispiel Suspenden) dann das Programm schließt (wie bei S4 League ,XTrap und HGWC) Hoffe ihr könnt mir helfen :handsdown: :D
04/30/2013 14:30 omer36#2
if ProcessExists ( "process" ) then ProcessClose ( "process" )

so?
04/30/2013 18:47 golle12#3
Quote:
Originally Posted by omer36 View Post
if ProcessExists ( "process" ) then ProcessClose ( "process" )

so?
Nein ich meine wenn der Prozess schon das ist und von einem Suspender suspended wird soll das programm checken und wenn es zu lange nichts macht soll es sich schließen (wie bei S4 League)

ich meinte so es funktioniert aber nicht :(

PHP Code:
Func _ProcessSuspend($Process)
        
$processid ProcessExists($Process)
        If 
$processid Then
                $ai_Handle 
DllCall("kernel32.dll"'int''OpenProcess''int'0x1f0fff'int'False'int'$processid)
                
$i_sucess DllCall("ntdll.dll""int""NtSuspendProcess""int"$ai_Handle[0])
                
DllCall('kernel32.dll''ptr''CloseHandle''ptr'$ai_Handle)
                If 
IsArray($i_sucessThen
                        
Return 1
                
Else
                        
SetError(1)
                        Return 
0
                
EndIf
        Else
                
SetError(2)
                Return 
0
        
EndIf
EndFunc   ;==>_ProcessSuspend

Func _ProcessResume
($Process)
        
$processid ProcessExists($Process)
        If 
$processid Then
                $ai_Handle 
DllCall("kernel32.dll"'int''OpenProcess''int'0x1f0fff'int'False'int'$processid)
                
$i_sucess DllCall("ntdll.dll""int""NtResumeProcess""int"$ai_Handle[0])
                
DllCall('kernel32.dll''ptr''CloseHandle''ptr'$ai_Handle)
                If 
IsArray($i_sucessThen
                        
Return 1
                
Else
                        
SetError(1)
                        Return 
0
                
EndIf
        Else
                
SetError(2)
                Return 
0
        
EndIf
    
EndFunc   ;==>_ProcessResume

    $Process 
"notepad.exe"
    
While 1
            
If $Process _ProcessSuspend($ProcessThen
                MsgBox
(0,"nein nein nein","so geht das nicht")
                
_ProcessResume($Process)
        EndIf
    
WEnd 
Es funktioniert leider nicht da es denn prozess permanent suspendet und dann wieder resumt aber es soll prüfen ob es suspendet ist und dann resume hoffe ihr könnt mir helfen?! :handsdown:
05/01/2013 22:09 Croco™#4
Vielleicht hilft dir das hier weiter:
[Only registered and activated users can see links. Click Here To Register...]

Code:
Func _NotResponding($title, $text, $closeIfHung = 0)
    $hWnd = WinGetHandle($title, $text)

If $hWnd == "0" Then
MsgBox(1,"Tets","Window not found")
EndIf
    $retArr = DllCall("user32.dll", "int", "IsHungAppWindow", "hwnd", $hWnd)
    If @error == 0 Then
        If $retArr[0] == 1 Then
            If $closeIfHung Then
                ProcessClose(WinGetProcess($title, $text))
            EndIf
            Return 1
        EndIf
    Else
        Return 0
    EndIf
EndFunc