Here's a deconstructed script that I am tryng to do:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode, 2
#WinActivateForce
#IfWinActive Virtual Machine Connection
#^Left::
MsgBox xxx
However, this does not work when the focused window is the actualy virtual machine connection. If I remove the #ifWinActive line for example, this will work as expected for all winsdows, but not when the Virtual Machine Connection is the active window.