https://autohotkey.com/boards/viewtopic ... 93#p182593
After sometime, I found below code only worked in one tab (maybe the first open tab ?? )
Code: Select all
#IfWinExist ahk_exe Clover.exe
#Space::
WinActivate
ControlFocus, DirectUIHWND3, A
return
#IfWinExist
--------------------------
I use a test code to show the problem:
Code: Select all
#IfWinExist ahk_exe Clover.exe
#Space::
WinActivate
WinActivate "ahk_exe explorer.exe"
ControlFocus, DirectUIHWND3, A
;; print focus
ControlGetFocus, DirectUIHWND3, A
if ErrorLevel
MsgBox, The target window doesn't exist or none of its controls has input focus.
else
MsgBox, Control with focus = %OutputVar%
;; select first
SendInput, {Space}
Return
#IfWinExist
this tab can be focused
this tab can't
How do I solve this problem ?