int child(text [class] [window] [flags] [x y] [matchindex|array]) int childtest(hwnd text [class] [window] [flags] [x y])
int child(id [text] [class] [window] [flags] [x y] [matchindex|array]) int childtest(hwnd id [text] [class] [window] [flags] [x y])
int child(x y [window] [flags2]) int childtest(hwnd x y [window] [flags2])
int child(mouse) int childtest(hwnd mouse)
int child(acc) int childtest(hwnd acc)
int child
text - child window text.
class - child window class name.
window - parent window.
| 1 | text must match exactly or may contain wildcard characters (*?). String "*" matches child windows with no name. This flag cannot be used with flag 0x200 (regular expression). |
| 2 | text case insensitive. |
| 4 | Use different method to get text. The flag must be used for edit, rich edit and some other controls. |
| 8 | x and y are coordinates in window client area. |
| 16 | Immediate child. If not set, the function also finds children of immediate children and so on. |
| 32 | x and y are screen coordinates. |
| 8|32 | x and y are coordinates in the work area. |
| 128 | x is style. Cannot be used with 0x8000. |
| 0x100 | y is extended style. Cannot be used with 0x8000. |
| 0x200 | text is is regular expression. Alternatively, use $ character at the beginnig. Flags 1, 16 and 0x200 cannot be used together. |
| 0x400 | Must be visible. |
| 0x800 | Use wildcard characters in class. |
| 0x8000 | Use callback function. |
x, y - define a point in the parent window or screen (flag 32) that must belong to the child window.
matchindex (QM 2.2.0) - 1-based index of matched child window in the parent window. Use when there are several child windows (in the parent window) that match other properties (text, class, flags, x, y, id).
array (QM 2.2.1) - variable of type ARRAY(int) that will receive handles of all matching child windows.
id - child window id.
flags2 - combination of values listed below. Default: 0.
| 8 | x and y are coordinates in client area of window |
| 16 | immediate child |
| 32 | x and y are screen coordinates |
| 8|32 | x and y are coordinates in the work area |
accobj - accessible object. Type - Acc or IAccessible.
hwnd - handle of child window to test.
Finds a child window (control) in the specified window, and returns its handle. Returns 0 if not found. Error if parent window does not exist.
Syntax1 and 2: finds child window whose text and other properties match the specified properties.
Syntax3: Returns handle of child window from the specified point in its parent window. If window is omitted or "" - active window. If window is 0 (constant), parent can be any window (x and y are screen coordinates).
Syntax4: Returns handle of child window (except invisible) from mouse pointer position.
Syntax5: Returns handle of child or top-level window that matches or contains accessible object accobj.
Syntax6: Returns handle of child window that has focus. To get focused window of current thread, use GetFocus instead.
Function childtest evaluates child window (hwnd) properties, and returns 1 if they match, or 0 if not. If window is omitted or literal 0, parent window is not evaluated.
act child("Hex" "Button" "Calculator") if child("The text*" "Static" "Notepad" 1) bee int h = child(100 100 "Notepad") h = child(mouse) if(childtest(h "OK" "Button")) but h