>>60047813
I dug up an old AutoIt script that suspends/resumes the acive window's process via hotkey. I'll post it here since your thread on >>>/v/ got archived.
HotKeySet("{ESC}", "Quit")
HotKeySet("{=}", "ToggleSuspension")
Global $lastPID = 0
While 1
Sleep(20)
WEnd
Func ToggleSuspension()
$lastPID = ProcessExists($lastPID)
If $lastPID > 0 Then
ConsoleWrite("resuming process " & $lastPID & @CRLF)
_ProcessSuspendResume($lastPID, 1)
$lastPID = 0
Else
$lastPID = WinGetProcess("[ACTIVE]")
ConsoleWrite("suspending process " & $lastPID & @CRLF)
_ProcessSuspendResume($lastPID, 0)
EndIf
EndFunc
Func _ProcessSuspendResume($processID, $resume = 0)
Local $func = "NtSuspendProcess"
If $resume > 0 Then $func = "NtResumeProcess"
If $processID > 0 Then
Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processID)
Local $i_sucess = DllCall("ntdll.dll", "int", $func, "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 Quit()
Exit
EndFunc