The way I interpret this sentence is that the HWND (the _handle_) of the Gui window is _not_ a name of the Gui window. Note that the sentence does _not_ describe the case where the Gui window has _both_ 'the name' and the handle; in that context, the sentence would be correct I guess. Or perhaps, 'instead of a name' could be read that if the name is an empty string, then A_Gui contains HWND?Gui, New wrote:If the GUI which launched the current thread was created this way, A_Gui contains a HWND instead of a name.
Gui, New wrote:If a name is specified, any existing GUI with that name is destroyed.
Code: Select all
DetectHiddenWindows, On Gui, new, hwndh1 MsgBox % WinExist("ahk_id" h1) > 0 ; 1 gui, %h1%:new MsgBox % WinExist("ahk_id" h1) > 0 ; 0
Another thing is this:
So A_Gui can't contain the handle of the Gui window, because the handle is not the name, which seems contradictory with:A_Gui wrote:The name or number of the GUI that launched the current thread. This variable is blank unless a Gui control, menu bar item, or event such as GuiClose/GuiEscape launched the current thread.
... A_Gui contains a HWND instead of a name.