WinTitle (define/exemplify window title first), SetTitleMatchMode (examples) Topic is solved

Share your ideas as to how the documentation can be improved.
neogna2
Posts: 617
Joined: 15 Sep 2016, 15:44

WinTitle (define/exemplify window title first), SetTitleMatchMode (examples)

Post by neogna2 » 26 Jan 2023, 06:13

(Yes, this is very basic, but clarifying/exemplifying basics help beginners.)

WinTitle
https://www.autohotkey.com/docs/v2/misc/WinTitle.htm
The WinTitle doc page talks about the window title, but does not explain it nor (early and simply) exemplify. In contrast other WinTitle alternatives on that page like A have simple inline examples e.g. MsgBox WinExist("A")

Suggestion: Add a subsection named "Window Title" (above "Matching Behaviour") with this short explainer text:
---
The title of a window is often visible as text in a title bar at the top of the window. If invisible or only partially visible the complete window title can be read with WinGetTitle or Window Spy.

For example the Calculator app has the window title "Calculator", which can be used as WinTitle parameter
WinActivate("Calculator")
---

SetTitleMatchMode
https://www.autohotkey.com/docs/v2/lib/SetTitleMatchMode.htm
Add a simple side by side example of MatchMode use:

#3 Four ways to activate a window titled "Calculator"

Code: Select all

SetTitleMatchMode 1 ;must start with
WinActivate("Calcu") 

SetTitleMatchMode 2 ;contain anywhere
WinActivate("alculato")

SetTitleMatchMode 3 ;match exactly
WinActivate("Calculator") 

SetTitleMatchMode "RegEx"
WinActivate("Cal.*ato")

User avatar
Ragnar
Posts: 764
Joined: 30 Sep 2013, 15:25

Re: WinTitle (define/exemplify window title first), SetTitleMatchMode (examples)  Topic is solved

Post by Ragnar » 18 Aug 2023, 06:01

Thanks for the suggestions. I've added your first suggestion.

Post Reply

Return to “Suggestions on Documentation Improvements”