EDIT: I found a answer to my problem at the end of my post.
Hello, I've come across the same problem and I wanted to ask if any one knows why being more specific as Lexikos stated does not work in this situation:
I am identifying the
Data folder name adding both
ahk_class CabinetWClass and
ahk_exe Explorer.exe
but I tested many times and the window is simply not recognised by
WinExist()
While on the other hand, when I am LESS SPECIFIC - which is my question - it works ??
What's wrong with Explorer that makes it unreliable even when super precise like shown above ?
EDIT: With other window types like chrome windows for example - the same method will retrieve window info correctly. Only Explorer.exe windows seem to be involved in the identification problem.
EDIT2: all the info I use is from AHK's bult-in Window Spy
output results of WinGetPos and WinGet,v, MinMax
[Data ahk_class CabinetWClass]
x=1219
y=375
w=1139
h=637
MinMax=0
[Data ahk_class CabinetWClass ahk_exe Explorer.exe]
x=
y=
w=
h=
MinMax=
Final Edit - Partial answer to my question:
AHK's built-in Window Spy tells me this info when I get the explorer window info:
Data
ahk_class CabinetWClass
ahk_exe Explorer.EXE
ahk_pid 9788
But when using WinExist("Data ahk_class CabinetWClass ahk_exe Explorer.EXE"), the function return null.
Unexpectedly, I need to modify Window Spy's output to ALL LOWER CHARACTERS no caps allowed like so:
Data ahk_class CabinetWClass ahk_exe explorer.exe
I am using SetTitleMatchMode RegEx and the doc says :
"Window titles are case sensitive, except when using the i) modifier in a RegEx pattern."
So if I want to do something like WinExist(winTitleRegEx) i need to add this:
WinExist("i)" winTitleRegEx) or how would you do it ?
Code: Select all
For winTitle in mySavedWindows {
winTitleRegEx:="i)" . winTitle
if (hWnd := WinExist(winTitleRegEx)) {
Doesn't work