Autohotkey partial window title match (no ahk class)

I would like to add a partial match for the window titles in #IfWinActive. For example, to match any notepad window, regardless of whether the heading is "Untitled - Notepad" or "MyFile - Notepad"

It should be very simple. My attemtps:

SetTitleMatchMode, Regex SetTitleMatchMode, Slow #IfWinActive *.Notepad +n::b #IfWinActive 

matchmode 2's second attempt should match anywhere

 SetTitleMatchMode, 2 #IfWinActive Notepad +n::b #IfWinActive 

Testing using the full name Untitled - Notepad confirms that the code + n :: b substitutes Shift-n for Shift-b

NOTE. ahk_class is not an option because the class is different on each computer for the TeXnicCenter target program

+7
source share
1 answer

As Robert Ilbrink said , my second example really works, and the problem is that I did not place SetTitleMatchMode at the very top of my script.

The default script example for ^!n acted and intervened. It’s not entirely clear why this is so, but setting SetTitleMatchMode at the top solved my problem.

+5
source

All Articles