I posted this originally in a duplicate of this topic without noticing Hellbent's already existing answers about ahk_ids - so this might not help much further.
Anyway, I moved this post, so that the duplicate topic could be removed:
command only sends its keys once, to the first matching
window it finds. Hidden windows might add new matching windows to the mix that before wouldn't be found:
There might be other hidden (or still visible) windows/processes with the same ahk_exe
property that your script sends to - this property is not necessarily unique to a single window. WinGet, , List
((or a look into the task manager) might help to clear this up.
Btw, how do you know that your keys don't get send ? Do you hide/unhide these windows yourself ?
Perhaps save their unique ahk_id
before hiding these windows, so that you can use these IDs in ControlSend
parameter afterwards, instead of ahk_exe
. That should take care of the ambiguity...