Good question and problem. Typically these "subprocesses" of a "program" are triggered by running that program with the appropriate parameters, but even so, the process itself is still that program. Given that the Game Mode only takes the process name as input in its list, I'm almost certain that what you want is not possible, at least in the way you described.For my specific case, I want to do so for a GUI created via AHK. For a more common example, consider something instead like a tab in the Edge browser — in Task Manager you can see that tab listed as a uniquely named subprocess for the Microsoft Edge app. The same is true for my case with an AHK GUI.
I don't want to trigger simply on the greater process running, but rather just if a specific subprocess of that program is running. Is this possible?
That being said, if you forget about triggering Game Mode itself (something you cannot do on demand anyway, since there's no bang related to it) and focus on triggering the actual actions / bangs you want Game Mode to execute instead (like unloading and loading skins or layouts), then it's possible in your case.
You said that you already get the name of the said subprocess in your AHK script (well, actually its window name, since the process is the same), and an AutoIt / AutoHotKey script can send bangs to Rainmeter or a Rainmeter skin, so you'll just need to monitor if that subprocess / window is running in your script, and when it is spawned or ended, send the desired bangs to Rainmeter or your Rainmeter skin.
See here for the AutoIt way to send bangs:
https://docs.rainmeter.net/developers/#SendMessage
See here for the AutoHotKey way to send bangs:
https://forum.rainmeter.net/viewtopic.php?t=40813#p223600
See here for a one time AutoIt retrieval of a window:
https://forum.rainmeter.net/viewtopic.php?t=21785#p115480
See here for a background AutoIt retrieval of more windows:
https://forum.rainmeter.net/viewtopic.php?t=42450&start=20#p215590
Most of the above use an AutoIt script, but such a script can be replicated in an AutoHotKey script. You probably don't need everything there for your case, just the send bang function, which you can use in your existing script, assuming you adjust it to check for the spawning and closing of the window with the desired name.
Statistics: Posted by Yincognito — December 21st, 2024, 11:37 am