ui_get_window_tree
Get the visual tree of a debugged .NET application to inspect and interact with top-level windows and modal dialogs. Enables GUI automation during debugging.
Instructions
Get the visual tree of the debugged application — ALL top-level windows.
Covers the main app window and any sibling windows (modal dialogs, popups, file pickers) owned by the same process. Modal dialogs created via WPF Window.ShowDialog() are sibling top-level windows, not descendants of the main window — they appear in the "windows" array alongside the main window.
Call after start_debug and wait for the application window to appear.
Args: max_depth: Maximum depth to traverse within each window (default 3) max_children: Maximum children per element (default 50)
Returns: FlaUI backend: {"windows": [tree, ...], "count": N, "primary": "Main App"} Each tree entry carries automationId, controlType, name, rect, children, etc. Use ui_switch_window to retarget subsequent calls at a specific window (e.g. a modal dialog).
pywinauto fallback backend: a single-window tree dict with
automationId/name/rect/children at the root (no windows array,
no count, no primary). Callers that need to support both
backends should probe for the "windows" key and fall back to
treating the response itself as a single-window tree.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_depth | No | ||
| max_children | No |