Skip to main content

Overview

Microsoft UI Automation (UIA) is a modern accessibility API that provides programmatic access to UI elements. NVDA uses UIA to support modern Windows applications, Windows Terminal, Microsoft Office, and other UIA-aware applications.

Architecture

Core Components

The NVDA UIA implementation consists of several key modules:
  • UIAHandler: Core UIA initialization and management
  • UIAHandler.remote: Remote operations for better performance
  • UIAHandler.browseMode: Browse mode for UIA documents
  • UIAHandler.customAnnotations: Custom annotation support
  • UIAHandler.customProps: Custom property definitions

UIA Element Hierarchy

Working with UIA in NVDA

Checking if UIA Should Be Used

Control Type Mapping

UIA Events

Event Registration

Event Mapping

Text Patterns

Using TextPattern

Formatting Information

Remote Operations

Remote operations allow batching multiple UIA calls for better performance:

Custom Annotations

Best Practices

Performance

Use remote operations to batch UIA calls and reduce COM overhead

Error Handling

Always catch COMError when accessing UIA properties - elements may become invalid

Caching

Use UIA cache requests to pre-fetch commonly accessed properties

Event Filtering

Only register for events you actually need - UIA can generate many events
UIA elements can become stale if the underlying UI changes. Always be prepared to handle exceptions.

Common Patterns

Finding Elements

Walking the Tree

Reference

Key Modules

  • UIAHandler: Core UIA implementation
  • UIAHandler.types: Type definitions and constants
  • UIAHandler.utils: Utility functions
  • UIAHandler.remote: Remote operations
  • comInterfaces.UIAutomationClient: COM interfaces

Important Constants

Configuration

Developer Guide

See the NVDA Developer Guide for complete plugin development information

Microsoft UIA Documentation

Official Microsoft documentation for UI Automation