GuiFromHwnd

Retrieves the Gui object of a GUI window associated with the specified HWND.

GuiObj := GuiFromHwnd(Hwnd , RecurseParent := false)

Parameters

Hwnd

Type: Integer

The window handle (HWND) of a GUI window. Such window could be created with Gui.New.

RecurseParent

Type: Integer (boolean)

If this parameter is 1 (true), the closest parent to the specified HWND that is a GUI is automatically searched for and retrieved.

Return Value

Type: Object

This function returns a reference to an existing Gui object. This object provides methods and properties for creating and managing windows, and creating controls.

Remarks

For example, a HWND of a GUI window can be retrieved via Gui.Hwnd, WinExist or WinGetID.

Related

Gui.New, Gui object, GuiControl object, GuiCtrlFromHwnd, Control Types, ListView, TreeView, Menu object, Control functions, MsgBox, FileSelect, DirSelect

Examples

#1

MyGui := Gui.New(, "Title of Window")
MyGui.Add("Text",, "Some text to display.")
MyGui.Show()

MsgBox(GuiFromHwnd(MyGui.Hwnd).Title)