A script that can suspend and resume another ahk script when another program loses/gains focus?
Posted: 13 Aug 2018, 01:11
Hello, I apologize if the title seems confusing (it's the best that I can come up with right now), but I will try to explain what my request is in better detail.
I would like to have a ahk script that can suspend another compiled ahk script when a program loses focus in windows (windows 7 to be exact). Then when that said program regains focus, have the same script resume the compiled script it suspend earlier.
To go in greater detail: my pc setup is for an arcade cabinet, and the program I reference earlier is an arcade frontend called Hyperspin. As for the compiled ahk script, it is a screensaver that starts up a video after set amount of time of inactivity. The problem is, the script will start up a video even when Hyperspin is no longer in focus, which causes some issues with whatever game is running at that time. So that's why I would like to have a ahk script that can suspend the screensaver script when Hyperspin is not in focus, then resume the screensaver script when Hyperspin regains its focus.
I tried looking into how to write the ahk script myself, but I barely have any basic understanding of AutoHotKey (to put it kindly). I did end up guessing on what to write, but honestly I have no idea if the script even does anything close to what I want it to do, that is if it does anything at all. I just know it doesn't error out when it runs. lol
My pathetic attempt of a script.
Anyways, any help to create a working script will be greatly appreciated.
I would like to have a ahk script that can suspend another compiled ahk script when a program loses focus in windows (windows 7 to be exact). Then when that said program regains focus, have the same script resume the compiled script it suspend earlier.
To go in greater detail: my pc setup is for an arcade cabinet, and the program I reference earlier is an arcade frontend called Hyperspin. As for the compiled ahk script, it is a screensaver that starts up a video after set amount of time of inactivity. The problem is, the script will start up a video even when Hyperspin is no longer in focus, which causes some issues with whatever game is running at that time. So that's why I would like to have a ahk script that can suspend the screensaver script when Hyperspin is not in focus, then resume the screensaver script when Hyperspin regains its focus.
I tried looking into how to write the ahk script myself, but I barely have any basic understanding of AutoHotKey (to put it kindly). I did end up guessing on what to write, but honestly I have no idea if the script even does anything close to what I want it to do, that is if it does anything at all. I just know it doesn't error out when it runs. lol
Code: Select all
Nothing to see here...
Anyways, any help to create a working script will be greatly appreciated.