Web-Net
Вторник, 10.01.2012, 21:24 | Сообщение # 1
Сообщений: 14
1)Открываем пустой скрипт Autoit 2)Вписываем код для заморозки процесса Code Code
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $process="notepad.exe",$fSuspended #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("notepad.exe", 330, 165, 462, 344) GUISetCursor (3) GUISetBkColor(0xB9D1EA) $Button1 = GUICtrlCreateButton("Заморозить\разморозить", 56, 32, 209, 97) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _ProcSuspendResume($process) EndSwitch WEnd Func _ProcSuspendResume($process) $processid = ProcessExists($process) If $processid Then If $fSuspended 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 $fSuspended = 0 Return 1 Else SetError(1) Return 0 Endif Else $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 $fSuspended = 1 Return 1 Else SetError(1) Return 0 Endif EndIf Else SetError(2) Return 0 Endif EndFunc Global $fSuspended = 0
В этом скрипте процессом для заморозки является блокнот,но вы его можете изменить поменяв эту строчку Global $process="notepad.exe" допустим на Global $process="pb.exe".Теперь нажимаете компилировать и должно появится вот это: Все теперь при нажатие на "Заморозить/Разморозить" будет заморажеватся pb.exe