GuiCtrlFromHwnd

Retrieves the GuiControl object of a GUI control associated with the specified HWND.

GuiControlObj := GuiCtrlFromHwnd(Hwnd)

Parameters

Hwnd

Type: Integer

The window handle (HWND) of a GUI control, or a child window of such a control (e.g. the Edit control of a ComboBox). The control must have been created by the current script, by calling Add or AddControlType.

Return Value

Type: GuiControl or String (empty)

This function returns the GuiControl object associated with the specified HWND, or an empty string if there isn't one or the HWND is invalid.

Remarks

For example, a HWND of a GUI control can be retrieved via GuiCtrl.Hwnd, MouseGetPos or OnMessage.

Gui(), Gui object, GuiControl object, GuiFromHwnd, Control Types, ListView, TreeView, Menu object, Control functions, MsgBox, FileSelect, DirSelect

Examples

See the ToolTip example on the Gui object page.