Match class, but only if no window Title Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Quisquose
Posts: 49
Joined: 24 Jun 2016, 04:16

Match class, but only if no window Title

13 Jun 2019, 06:25

I'm trying to match a specific class, but only when that class has no window title. If the same class is detected but it does have a window title, then I want it ignored (regardless of what the title is).

How do I structure the command for this?
Rohwedder
Posts: 2218
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Match class, but only if no window Title  Topic is solved

13 Jun 2019, 07:41

Hallo,
run Notepad and try:

Code: Select all

SetTitleMatchMode, RegEx
#IfWinActive ^$ ahk_class Notepad
q::MsgBox, Notepad without title!
#IfWinActive ahk_class Notepad
q::WinSetTitle ahk_class Notepad,,,
The first press of key Q deletes the title, the second press shows the MsgBox
Quisquose
Posts: 49
Joined: 24 Jun 2016, 04:16

Re: Match class, but only if no window Title

14 Jun 2019, 07:55

Success! It works.

Much obliged.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], fwejifjjwk2, Odlanir and 54 guests