literal Window Title?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
chef423
Posts: 213
Joined: 28 Aug 2016, 12:10
Contact:

literal Window Title?

08 Mar 2018, 14:13

Window Title, Class and Process
#1
Cash Register Express
ahk_class WindowsForms10.Window.8.app.0.30495d1_r14_ad1
ahk_exe CRE2004.exe

VS

#2
Window Title, Class and Process
Cash Register Express -- Station: 01 -- Cashier: 100199 -- 3/8/2018 11:10 AM
ahk_class WindowsForms10.Window.8.app.0.30495d1_r14_ad1
ahk_exe CRE2004.exe

My code:

Code: Select all

; Login Button
+F12::
IfWinExist, Cash Register Express
{
WinActivate, Cash Register Expres
Send, 77{Enter}
Send, 77{ENTER}
}
Else
{
; do nothing
}
Return
BUT, this +F12 key is still working on the Cash Register Express -- Station: 01 -- Cashier: 100199 -- 3/8/2018 11:10 AM, window

How can I only make this code execute with #1, not #2 (or any other window)
Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: literal Window Title?

08 Mar 2018, 14:16

Code: Select all

SetTitleMatchMode, 3
From the docs
MatchMode

One of the following digits or the word RegEx:

1: A window's title must start with the specified WinTitle to be a match.
2: A window's title can contain WinTitle anywhere inside it to be a match.
3: A window's title must exactly match WinTitle to be a match.
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
chef423
Posts: 213
Joined: 28 Aug 2016, 12:10
Contact:

Re: literal Window Title?

08 Mar 2018, 14:27

You rock! Thanks!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ntepa, scriptor2016 and 192 guests