According to the help file:
Also:DetectHiddenWindows wrote: If false, hidden windows are not detected, except by the WinShow function.
So the behavior shown here is unexpected to me:WinExist wrote: Window titles and text are case-sensitive. By default, hidden windows are not detected and hidden text elements are detected, unless changed with DetectHiddenWindows and DetectHiddenText.
Code: Select all
DetectHiddenWindows false
main := Gui()
MsgBox WinExist(main) ; A handle is shown
Code: Select all
DetectHiddenWindows false
main := Gui()
WinWait(main) ; This stays waiting for the window to exist and enters an infinite wait...
MsgBox 'Window Found'
Code: Select all
DetectHiddenWindows false
main := Gui()
MsgBox WinGetPID(main) ; displays a pid
v1 Doesnt seem to be affected by this issue:
Code: Select all
DetectHiddenWindows 0
Gui, New,, My Window
; Gui Show, w300 h300
WinGet, PID, PID, My Window
MsgBox %PID% ; this returns empty unless the line above is uncommented