Returns the unique ID numbers for all controls in the specified window.
Controls := WinGetControlsHwnd(WinTitle, WinText, ExcludeTitle, ExcludeText)
Type: String, Integer or Object
A window title or other criteria identifying the target window. See WinTitle.
If present, this parameter must be a substring from a single text element of the target window (as revealed by the included Window Spy utility). Hidden text elements are detected if DetectHiddenText is ON.
Windows whose titles include this value will not be considered.
Windows whose text include this value will not be considered.
This function returns an array containing the window handles (HWND) for all controls in the specified window. If there is no matching window, an empty string is returned.
For example, if the return value is assigned to a variable named
Controls and two controls are present,
Controls contains the ID of the first control,
Controls contains the ID of the second control, and
Controls.Length returns the number 2.
Controls are sorted according to their Z-order, which is usually the same order as the navigation order via Tab key if the window supports tabbing.
An exception is thrown if the window could not be found or there was an error retrieving the window handles (HWND) of its controls.
The ID of the window or control under the mouse cursor can be retrieved with MouseGetPos.
Window titles and text are case sensitive. Hidden windows are not detected unless DetectHiddenWindows has been turned on.
WinGetControls, Win functions, Control functions