Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- InputBox, UserInput, Game, Please enter a exe name with file ext
- ;WinGetActiveTitle , UserInput
- f1::
- if (toggle := !toggle)
- {
- Process_Suspend(UserInput)
- }
- else
- {
- Process_Resume(UserInput)
- }
- Process_Suspend(PID_or_Name){
- PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name
- h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid)
- If !h
- Return -1
- DllCall("ntdll.dll\NtSuspendProcess", "Int", h)
- DllCall("CloseHandle", "Int", h)
- Return
- }
- Process_Resume(PID_or_Name){
- PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name
- h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid)
- If !h
- Return -1
- DllCall("ntdll.dll\NtResumeProcess", "Int", h)
- DllCall("CloseHandle", "Int", h)
- }
- ProcExist(PID_or_Name=""){
- Process, Exist, % (PID_or_Name="") ? DllCall("GetCurrentProcessID") : PID_or_Name
- Return Errorlevel
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement