Проблему с функцией Run я решил, но возникли другие
Вот весь скрипт:
Почему-то не работает приостановление процесса и окно скрипта не сворачивается(
Вот весь скрипт:
Код:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#AutoIt3Wrapper_UseX64=N
Global $process="PB.exe",$Suspended
#Region ### START Koda GUI section ### Form=
GUISetBkColor(0xFFFFFF)
$Form1 = GUICreate("RunCE", 142, 115, 50, 50, BitOR($WS_POPUP, $WS_BORDER))
$Close = GUICtrlCreateLabel("X", 142 -15, 0, 11, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetCursor(-1, 0)
$Minimize = GUICtrlCreateLabel("_", 142 -45, 0, 11, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetCursor(-1, 0)
$Help = GUICtrlCreateLabel("?", 142 -30, 0, 11, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetCursor(-1, 0)
$Formtitle = GUICtrlCreateLabel(" RunCE", 0, 3, @DesktopWidth, 15, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Formtitlebackground = GUICtrlCreateGraphic(0, 0, @DesktopWidth, 22)
GUICtrlSetBkColor(-1, 0x000000)
$Button1 = GUICtrlCreateButton("Запустить CE", 8, 33, 123, 33)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton("Почистить реестр", 8, 73, 123, 33)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Close
Exit
Case $Button1
ProcSuspendResume($process)
Run("D:\CE Paradocs\cheatengine.exe")
GUISetState(@SW_HIDE)
ProcessWaitClose("cheatengine.exe")
ProcSuspendResume($process)
GUISetState(@SW_SHOW)
Case $Button2
Case $Minimize
GUISetState(@SW_MINIMIZE)
Case $Help
MsgBox(96, "Информация", "В разработке")
EndSwitch
WEnd
Func ProcSuspendResume($process)
$processid = ProcessExists($process)
If $processid Then
If $Suspended 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
$Suspended = 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
$Suspended = 1
Return 1
Else
SetError(1)
Return 0
Endif
EndIf
Else
SetError(2)
Return 0
Endif
EndFunc
Global $Suspended = 0
Почему-то не работает приостановление процесса и окно скрипта не сворачивается(