What I need it to do is to also ignore certain EXEs (predominantly Outlook) which contain certain words which are also qualifiers for the window titles.
Any help would gratefully appreciated.
Code: Select all
#Persistent
status := GetKeyState("Capslock", "T") ? "On" : "Off" ; save current caps lock state
OldTitle = ; set oldtitle to 'blank"
SetTimer, CheckWinTitle, 500 ; Causes a subroutine to be launched automatically and repeatedly at a specified time interval.
return
CheckWinTitle:
WinGetTitle, Title, A ; retrieve current window title, store in variable 'title'
WinGetClass, Classic, A ; retrieve current window CLASStitle, store in variable 'classic'
if Title = ; if the window title is blank use the classtitle instead
Title .= " " Classic
if (Title = OldTitle) ; if the title still matches the oldtitle we got last scan then we don't need to change anything
return
OldTitle := Title ; but if it doesn't match store the new title in oldtitle for next scan's comparison
if title contains WireTrac,Syteline,Form1,Report Manager,Harness Creation,PPAP,EMD,KRSC,EXCEL
{ ; if title contains any of the above program names then turn on CAPSLOCK
; If the title doesn't match set the caps lock back to what it was.
;status := GetKeyState("Capslock", "T") ? "On" : "Off"
SetCapsLockState, On
}
else
SetCapsLockState, %status% ; ...Put caps lock back to the state it was when we started.
return