Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. F5::
  2.  
  3. WinGetActiveTitle, Active_Title
  4.  
  5. if (toggle := !toggle) {
  6.  
  7. Process_Suspend("Active_Title")
  8.  
  9. ;MsgBox, Active_Title suspended
  10.  
  11.  
  12.  
  13.  
  14. Process_Suspend(PID_or_Name){
  15.  
  16. PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name
  17.  
  18. h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid)
  19.  
  20. If !h
  21.  
  22. Return -1
  23.  
  24. DllCall("ntdll.dll\NtSuspendProcess", "Int", h)
  25.  
  26. DllCall("CloseHandle", "Int", h)
  27.  
  28. }
  29.  
  30. } else {
  31.  
  32. Process_Resume("Active_Title")
  33.  
  34. ;MsgBox, Active_Title resumed
  35.  
  36.  
  37.  
  38. Process_Resume(PID_or_Name){
  39.  
  40. PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name
  41.  
  42. h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid)
  43.  
  44. If !h
  45.  
  46. Return -1
  47.  
  48. DllCall("ntdll.dll\NtResumeProcess", "Int", h)
  49.  
  50. DllCall("CloseHandle", "Int", h)
  51.  
  52. }
  53.  
  54.  
  55.  
  56. ProcExist(PID_or_Name=""){
  57.  
  58. Process, Exist, % (PID_or_Name="") ? DllCall("GetCurrentProcessID") : PID_or_Name
  59.  
  60. Return Errorlevel
  61.  
  62. }
  63. }
  64. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement