Locate and interact with Windows desktop UI elements using FlaUI's UIA3Automation and ConditionFactory

domain: desktop-automation · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Reference the `FlaUI.Core` and `FlaUI.UIA3` NuGet packages (or `FlaUI.UIA2` for the legacy UIA provider) in your .NET project
  2. Start or attach to the target process with `FlaUI.Core.Application.Launch("app.exe")`
  3. Wrap interactions in `using (var automation = new UIA3Automation())` and get the window via `app.GetMainWindow(automation)`
  4. Find elements with `window.FindFirstDescendant(cf => cf.ByText("1"))` (or other `ConditionFactory` conditions) and cast to a typed wrapper, e.g. `.AsButton()`, before calling `.Invoke()`
  5. Dispose the `UIA3Automation` instance (via the `using` block) when done so native UIA resources are released
  6. Fall back to `FlaUI.UIA2` if the target is a legacy WinForms app that behaves inconsistently under the UIA3 provider

Known gotchas

Related routes

Use PowerShell with FlaUI to find and interact with UI elements of a native Windows desktop app
github.com/FlaUI/FlaUI · 5 steps · unrated
Automate native Windows application UI using PowerShell and the Windows UI Automation framework
docs.microsoft.com · 6 steps · unrated
Inspect and drive native Windows application UI using Windows UI Automation (UIA) from code or inspection tools
learn.microsoft.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans