Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance,Force
;#NoTrayIcon
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode 2
^Space::
;WinGet, myWnd, ID, A
WinGet, myWndPID, PID, A
MsgBox myWndPID = %myWndPID%
return
^!Space::
Sleep, 333
;MsgBox myWnd = %myWnd%`nID = %ID%
MsgBox myWndPID = %myWndPID%
WinActivate, ahk_pid myWndPID
return
What am I doing wrong?