

Msgbox,0x1020,, This window's id and title are`nId:`t%w1id%`ntitle:`t%w1title% press the middle mouse button to identify that window Tooltip, place mouse over the window you want to identify. TL DR: function that, when a specific key is pressed, detects the ahk_id of the window on focus, to be able to send keystrokes to it even when it becomes inactive or unfocused, while having another copy of that game open that DOESN'T receive the keystrokes. Please excuse code errors, commas and the sort. I copied the routine bit from an old ahk forum thread (forgot which one now), the "inside" of the routine is my code.į12:: or any other key if f12 is problematic The end result should send the key "3" every 10 seconds to that specified window/ahk_id.

Basically I'd need something like mywindow := *code that checks ahk_id of the window I'm hovering, or better, that I press a key on/in.* I'm looking into winexist, please do tell if there's a better way. I need a portion of code that detects the ahk_id of the window I want, and returns the value to the variable MYWINDOW in this case. Code: Select all SetTimer, Routine, 10000
