LocateChildWindow
CUTools
Description
Find subordinate windows (child windows) in an application! LocateChildWindow locates dialogs, panels, embedded windows, and controls - no more hidden windows blocking your workflow!
With support for window classes, control IDs, and hierarchical search, you navigate complex UI structures - the key component for advanced UI automation!
Why This Tool Stands Out
- Find Child Windows in the hierarchy
- Locate Controls by class
- Identify dialogs & panels
- Handle for direct interaction
Perfect for:
UI automation developers, QA testers, and advanced power users who work with complex applications. Ideal for dialog interaction, control automation, and in-depth UI testing.
Workflow support; time savings depend on the task
Instead of manually navigating through nested dialogs, you find the child window you want instantly and interact with it directly - without detours through the main dialog.
JSON Parameters
- parentHandle REQUIRED (Integer)The window handle (HWND) of the parent window. Can be obtained via LocateAppWindow.
- className OPTIONAL (String)The Windows class of the child window (e.g., "Button", "Edit", "#32770" for dialogs)
- windowTitle OPTIONAL (String)Title or part of the title of the child window
- controlId OPTIONAL (Integer)The control ID of the element (for dialog controls)
- index OPTIONAL (Integer)Index if multiple matching child windows exist (0-based). Default: 0
Example Call
{
"tool": "LocateChildWindow",
"params": {
"parentHandle": 123456,
"className": "Button",
"windowTitle": "OK"
}
}
Example Usage
Typical AI Command
- "Find the OK button in Notepad's Save dialog and click it."
Return Values
The tool returns an object with the following properties:
- success (Boolean)
True if a child window was found - found (Boolean)
Whether a matching child window exists - windowHandle (Integer)
Window handle (HWND) of the child window found - className (String)
Windows class of the element found - windowTitle (String)
Title of the child window found - controlId (Integer)
Control ID of the element - x (Integer)
X position relative to the parent - y (Integer)
Y position relative to the parent - error (String, optional)
Error message if the search failed
Related Tools
Download CUTools
Get access to all 17 Computer Use tools for Windows automation.
Download Now