I'm building the last part of my arcade cabinet; PC arcade ports.
I'm launching the executable from Mala using an AHK script so I can remap a few keys along the way.
Everything works fine except that as you know, PC games can be "quit" via an on-screen menu and not just a button combo as set up by AHK. If the user quits via the on-screen menu with the mouse then the AHK script is still left running. How can I fix this?
For example, if I launch a game called Neverball, my script is set to kill the program using the following script (ending part of script) :
~2 & ~4:: ; This is my chosen 2-button key combo for quitting all games and emulators
Process, Close, Neverball.exe
ExitAPP
return
The above (closing) script works fine, but again, if the user uses the on-screen menu to "Quit to Desktop" using the mouse instead of hitting 2 & 4 together, then AHK ends up running in the background after the PC game has quit. It never gets to the "ExitAPP" part. If I'm not careful, I can have several AHK programs running at once in the background.
Isn't there some sort of "Win-Wait Program" command that will sense if the game (Neverball.exe) has quit by itself and then shut down the AHK script and then close Auto Hot Key?
I'm sure this is an easy fix, I'm just not quite sure on the details. Thanks in advance for any help.
