I'm sorry if this is obvious but I really have tried for many hours.
I want AHK to open JoyToKey then gzdoom.exe in that order which it does fine (I had to add sleep in the middle or JoyToKey would stay front of screen). Then, if I close gzdoom.exe I want AHK to close JoyToKey which I'm trying to use IfWinNotActive. However, it seems AHK is not identifying gzdoom.exe as active so it closes JoyToKey automatically before gzdoom.exe is closed manually.
Can someone please point out my error. I have also attached the winspy for gzdoom. Thank you in advance!
Code: Select all
Run, C:\Users\pc\Dropbox\Gaming\Z_Apps and Controllers\Joy2Key\JoyToKey_Doom Classic.lnk, C:\Users\pc\Dropbox\Gaming\Z_Apps and Controllers\Joy2Key
Sleep, 1000
Run, C:\Users\pc\Dropbox\Gaming\LaunchBox\Games\PC Games\Doom\Doom Project Brutality_1_2_Final_Master\gzdoom_doom2.exe.lnk, C:\Users\pc\Dropbox\Gaming\LaunchBox\Games\PC Games\Doom\Doom Project Brutality_1_2_Final_Master
IfWinNotActive, gzdoom.exe
Process, Close, JoyToKey.exe
Return
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]
[Mod action: Topic moved from "Scripts and Functions (v2) > Gaming)" for two reason: (1) this is AHK v1 code and the main section is for v2, and (2) "Scripts and Functions" is for sharing working scripts with others, not for seeking help with your scripts.]