Und zwar hab ich mit hilfe von autoit ein suspender gemacht und zwar kann er freezen resumen und killen aber irgend wie kann er keinen Prozess schließen da kommt immer so eine Fehlermeldung:
Line855 (File":"G:\Filme\Handy\Hack\Suspender\Suspender.ex e):
Error:Variable used without being declared.
ich hoffe das mir da einer helfen kann.Ich bedanke mich schon im Voraus.Hier Ist das Script:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvo ker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Global $PROCRESS_ALL_ACCESS = 0x001F0FFF
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_sucess) Then
Return 1
Else
SetError(1)
Return 0
Endif
Else
SetError(2)
Return 0
Endif
EndFunc
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_sucess) Then
Return 1
Else
SetError(1)
Return 0
Endif
Else
SetError(2)
Return 0
Endif
EndFunc
Func _ProcessClose($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","NtCloseProcess","int",$ ai_Handle[0])
DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle)
If IsArray($i_sucess) Then
Return 1
Else
SetError(1)
Return 0
Endif
Else
SetError(2)
Return 0
Endif
EndFunc
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=G:\Filme\Handy\Hack\Suspender\Program Suspender.kxf
$Form1 = GUICreate("Suspender", 394, 203, 192, 124)
$Input1 = GUICtrlCreateInput("Programm Name hier rein schreiben", 96, 24, 193, 21)
$Label2 = GUICtrlCreateLabel("", 24, 168, 153, 25)
$Label1 = GUICtrlCreateLabel("", 216, 168, 172, 25)
$Button1 = GUICtrlCreateButton("Suspend", 16, 80, 99, 41)
GUICtrlSetFont(-1, 12, 800, 0, "Calibri")
$Button2 = GUICtrlCreateButton("Resume", 144, 80, 99, 41)
GUICtrlSetFont(-1, 12, 800, 0, "Calibri")
$Button3 = GUICtrlCreateButton("Kill", 272, 80, 99, 41)
GUICtrlSetFont(-1, 12, 800, 0, "Calibri")
$Group1 = GUICtrlCreateGroup("Programm Manager", 1, 0, 391, 201)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$process = GUICtrlRead($Input1)
_ProcessSuspend($process)
MsgBox (0, "freeze", "Programm wurde gestoppt")
Case $Button2
_ProcessResume($process)
MsgBox (0, "resume", "Programm wird fortgesetzt")
Case $Button3
_ProcessClose($process)
MsgBox (0, "close", "Programm wurde geschlossen")
EndSwitch
WEnd