WinExist() bug?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
euras
Posts: 429
Joined: 05 Nov 2015, 12:56

WinExist() bug?

05 Mar 2019, 05:00

Hi, is it a bug in WinExist() function?
I try to create a script, which checks if the window appears during the run, except a couple of type windows. But the function gives me TRUE value, despite I add Exclude titles on both functions. It should return me a False value, but it doesn't work. The class I give is just a Folder class for testing purpose

Code: Select all

SettitleMatchMode, 2
If WinExist("ahk_class CabinetWClass",, "first folder") AND WinExist("ahk_class CabinetWClass",, "second folder") ; any folder can be opened except those two
	WinActivate
else
	Msgbox item does not exist
DRocks
Posts: 565
Joined: 08 May 2018, 10:20

Re: WinExist() bug?

05 Mar 2019, 06:41

There is something anormal with the cabinet class rather than with the winexist() I think. Try to forget about the cabinet class and use only Titles visible in the taskbar for your folder.

Also if you want it be more precise while be able to be flexible i suggeet you use RegEx TitleMatchMode

Let me know
just me
Posts: 9458
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: WinExist() bug?

05 Mar 2019, 07:32

Code: Select all

If WinExist("ahk_class CabinetWClass",, "first folder") AND WinExist("ahk_class CabinetWClass",, "second folder") ; any folder can be opened except those two
  • Both conditions resolve always to true for every window title exept "first folder" or "second folder".
  • Both conditions resolve to true if both windows "first folder" and "second folder" exist: Condition 1 for "second folder" and condition 2 for "first folder".
  • One of the conditions resolves to false if only one of the windows "first folder" or "second folder" exists.
So I believe it isn't a bug. ;)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: doanmvu, RSable and 376 guests