This
DOES work:
Code:
; ##############################################################################
#NoEnv
SetTitleMatchmode, 2
; ...
; ...
; ...
HotKey, IfWinActive, ^must be exactly another title$ ; MatchMode 3
Hotkey, a, Hotkey
Hotkey, IfWinActive
; ...
; ...
; ...
Gui, Margin, 0, 0
Gui, Font, s16
Gui, Add, Text, w400 h400 Center 0x200 cNavy vTX
Gui, Show, w400 h400, must be exactly another title
IfWinExist, exactly
MsgBox, Found Gui window!`nMatchMode : %A_TitleMatchMode%
GuiControl, , TX, Press "a", please.
; ...
; ...
; ...
SetTitleMatchMode, RegEx
Return ; end of auto-execute section
; ##############################################################################
GuiClose:
ExitApp
Hotkey:
MsgBox, Title matched "must be exactly another title"`nMatchMode : %A_TitleMatchMode%
Gui, Show, , title must start with ...
Return
#IfWinActive ^title must start with ; MatchMode 1
a::
MsgBox, Title matched "title must start with"`nMatchMode : %A_TitleMatchMode%
Gui, Show, , ... title must contain ...
Return
#IfWinActive title must contain ; MatchMode 2
a::
MsgBox, Title matched "title must contain"`nMatchMode : %A_TitleMatchMode%
Gui, Show, , title must be exactly
Return
#IfWinActive ^title must be exactly$ ; MatchMode 3
a::
MsgBox, Title matched "title must be exactly"`nMatchMode : %A_TitleMatchMode%
Gui, Show, , must be exactly another title
Return
#IfWinActive
Thanks to your code, i am gradually "getting" how SetTitleMatchMode works
- It is not positional (like #IfWinActive)
- It becomes the default for all code after it
in time not position (ie not positional)
What i would like though is:
1) #SetTitleMatchMode (positional; for context-sensitive static (׃׃) hotkeys (ie using #IfWin))
2) SetTitleMatchModeP (positional; for context-sensitive dynamic (Hotkey) hotkeys (ie using Hotkey, IfWin))
* Keeping the current "SetTitleMatchMode" command as it is (as is also useful to have)
(That is, to have BOTH the standard AND positional versions of this command)
Ps: Yes
i know nick, that
everything in my code can be done with RegEx .. but i "
don't want" to have to use RegEx for it all - i just want specifically to use RegEx for (this part of my code) but not for (that part of my code). Call it "programmer discretion"
