shadowz1337
shadowz1337

Reputation: 889

Autohotkey - SetTitleMatchMode not working

can someone help me with a simple question? I'm trying to get my IfWinExist working. I want the script below to only apply to windows with the title "Internet Download Manager", but not "Internet Download Manager - Configuration". At the moment, the script closes both of those windows.

SetTitleMatchMode 1 // have tried setting this to 3 as well but didn't work

SetTimer, CloseIDMRegistrationPopup2, 5000

CloseIDMRegistrationPopup2:
IfWinExist, Internet Download Manager
{
    Winget, annoyed, ID, Internet Download Manager
    WinActivate, ahk_id %annoyed%
    WinShow, ahk_id %annoyed%
    Sleep, 1000
    WinClose, ahk_id %annoyed%
    ;Send, {ESC}
}
return

Upvotes: 1

Views: 1959

Answers (1)

Jerry Jeremiah
Jerry Jeremiah

Reputation: 9618

According to

http://autohotkey.com/docs/commands/SetTitleMatchMode.htm

SetTitleMatchMode, 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.

So you should use:

SetTitleMatchMode, 3

Upvotes: 2

Related Questions