Code: Select all
SetTimer tTimer,500
tTimer:
If (WinActive("ahk_exe Discord.exe") && !fD){
Pause, On
If !WinActive("ahk_exe Discord.exe")
Pause, Off
Will appreciate any help.
Code: Select all
SetTimer tTimer,500
tTimer:
If (WinActive("ahk_exe Discord.exe") && !fD){
Pause, On
If !WinActive("ahk_exe Discord.exe")
Pause, Off
Remarks section of Pause documentation wrote:Whenever any thread is paused, timers will not run.
Code: Select all
DetectHiddenWindows, On
WM_COMMAND := 0x0111
ID_FILE_PAUSE := 65403
PostMessage, WM_COMMAND, ID_FILE_PAUSE,,, C:\YourScript.ahk ahk_class AutoHotkey
Code: Select all
If WinActive("ahk_exe Discord.exe") && (!A_IsPaused)
Pause, On
If !WinActive("ahk_exe Discord.exe") && (A_IsPaused)
Pause, Off
DetectHiddenWindows, On
WM_COMMAND := 0x0111
ID_FILE_PAUSE := 65403
PostMessage, WM_COMMAND, ID_FILE_PAUSE,,, C:\[path to my script] ahk_class AutoHotkey
Code: Select all
DetectHiddenWindows, On
WM_COMMAND := 0x0111
ID_FILE_PAUSE := 65403
loop {
WinWaitActive, ahk_exe Discord.exe
PostMessage, WM_COMMAND, ID_FILE_PAUSE,,, C:\[path to my script] ahk_class AutoHotkey
WinWaitNotActive, ahk_exe Discord.exe
PostMessage, WM_COMMAND, ID_FILE_PAUSE,,, C:\[path to my script] ahk_class AutoHotkey
}
return
Esc::ExitApp
Users browsing this forum: Google [Bot], yzqiang and 116 guests