For AI agents: the "Reading aid" section on this page contains the raw Markdown source identical to the rendered content, with HTML markup and animations removed. AI is advised to read that section directly to understand the content quickly and with less noise.
## Accessibility (UIA)

- The provider comes from `ZufyUIWindowTool.h`; element APIs are in the "Element base" chapter.
- Window APIs: `SetAccessibilityEnabled(bool)` (on by default), `FocusElement`, `GetFocused/Hovered/PressedElement`.

###block_red_start
**Pitfall**

- the library stores no history and does no file I/O; the provider reflects only the current frame. `WM_GETOBJECT` is handled only when enabled.
###block_red_end

## Debug / automation channel

```cpp
inline void SetDebugEnabled(bool);   inline bool IsDebugEnabled();
```
- Off by default. When on, the target window handles `WM_COPYDATA` (`dwData` = command id; reply `0x5A554631`) and returns current-frame info only (no file I/O).

| Cmd | Action | Cmd | Action |
|---|---|---|---|
| 1 | Ping | 12 | ClearHighlight |
| 2 | ListWindows | 13 | GetErrors (unified log E/W/I/D, ≤500) |
| 3 | GetFrameStats | 14 | ClearErrors |
| 4 | GetElementTree | 15/16/17 | TopN repaint/layout/cache (`all` = all) |
| 5 | ForceRepaint | 18 | TopN draw |
| 6 | SetElementText("id\ttext") | 19 | ResetCounters |
| 7 | InvokeElement | 20 | SetVisible("id\t0/1") |
| 8 | FocusElement | 21 | SetMargin("id\tx\ty") |
| 9 | GetElementInfo | 22 | SetHighlightColor("RRGGBB") |
| 10 | GetElementAt("x,y" screen→AutomationId) | | |
| 11 | Highlight(id) | 23 | GetTheme (theme name + AARRGGBB per role) |

- Unified log: `detail::Log(level, tag, msg)` / `LogWarning/LogInfo/DebugLog` / `RecordError` (→ E level + fires `UIZSignals::Error`).

###block_red_start
**Pitfall**

- send commands with a timeout (`SendMessageTimeout` without `SMTO_BLOCK`), or the debugger hangs when the target is busy. `ZUFYUI_DEBUG` is a **compile-time** switch (logging); `SetDebugEnabled` is a **runtime** switch (channel/stats) — do not conflate.
###block_red_end
Chapter 20

Accessibility & Debug Channel

UIA + SetDebugEnabled (v1.17.0)

Accessibility (UIA)

Pitfall

  • the library stores no history and does no file I/O; the provider reflects only the current frame. WM_GETOBJECT is handled only when enabled.

Debug / automation channel

cpp
inline void SetDebugEnabled(bool);   inline bool IsDebugEnabled();
Cmd Action Cmd Action
1 Ping 12 ClearHighlight
2 ListWindows 13 GetErrors (unified log E/W/I/D, ≤500)
3 GetFrameStats 14 ClearErrors
4 GetElementTree 15/16/17 TopN repaint/layout/cache (all = all)
5 ForceRepaint 18 TopN draw
6 SetElementText("id\ttext") 19 ResetCounters
7 InvokeElement 20 SetVisible("id\t0/1")
8 FocusElement 21 SetMargin("id\tx\ty")
9 GetElementInfo 22 SetHighlightColor("RRGGBB")
10 GetElementAt("x,y" screen→AutomationId)
11 Highlight(id) 23 GetTheme (theme name + AARRGGBB per role)

Pitfall

  • send commands with a timeout (SendMessageTimeout without SMTO_BLOCK), or the debugger hangs when the target is busy. ZUFYUI_DEBUG is a compile-time switch (logging); SetDebugEnabled is a runtime switch (channel/stats) — do not conflate.
↑