I have a script cobbled together that displays a different image depending on which window is active. I use this as a legend to show which macro keyboard shortcuts are active on the current focused window.
By and large I have it working, but the intended action is not reliable. If I focus on a window that's not listed in the various programs, the splashimage will deactivate, and won't come back up until I activate Excel again which is the first program in the stack.
If I comment out the other programs and just have one "WinwaitActive", it works flawlessly
Many thanks
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #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.
#Persistent
SetTitleMatchMode, 2
Goto Start
Start:
WinwaitActive, ahk_class XLMAIN
SplashImage, C:\Users\pretendUsername\AutoHotKey Scripts\GUI button layouts\Excel.jpg,A M B X-450 Y570, , , SplashImage , ,
WinWaitNotActive, ahk_class XLMAIN
SplashImage, Off
WinwaitActive, docx ;WINWORD.exe
SplashImage, C:\Users\pretendUsername\AutoHotKey Scripts\GUI button layouts\Word.jpg,A M B X-450 Y570, , , SplashImage , ,
WinWaitNotActive, docx ;ahk_exe WINWORD.exe
SplashImage, Off
WinwaitActive, ahk_exe acad.exe
SplashImage, C:\Users\pretendUsername\AutoHotKey Scripts\GUI button layouts\AutoCAD-Civil3D.jpg,A M B X-450 Y570, , , SplashImage , ,
WinWaitNotActive, ahk_exe acad.exe
SplashImage, Off
WinwaitActive, ahk_exe OUTLOOK.exe ;ahk_class rctrl_renwnd32;
SplashImage, C:\Users\pretendUsername\AutoHotKey Scripts\GUI button layouts\Outlook.jpg,A M B X-450 Y570, , , SplashImage , ,
WinWaitNotActive, ahk_exe OUTLOOK.exe ;ahk_class rctrl_renwnd32
SplashImage, Off
WinwaitActive, ahk_exe PDFXEdit.exe
SplashImage, C:\Users\pretendUsername\AutoHotKey Scripts\GUI button layouts\PDF XChange.jpg,A M B X-450 Y570, , , SplashImage , ,
WinWaitNotActive, ahk_exe PDFXEdit.exe
SplashImage, Off
#IfWinActive, ahk_exe Firefox.exe
SplashImage, C:\Users\pretendUsername\AutoHotKey Scripts\GUI button layouts\Firefox.jpg,A M B X-450 Y570, , , SplashImage , ,
WinWaitNotActive, ahk_exe Firefox.exe
SplashImage, Off
Goto Start