UiaProviderFromIAccessible function (uiautomationcoreapi.h)

Creates a Microsoft UI Automation provider based on the specified Microsoft Active Accessibility object.

Syntax

HRESULT UiaProviderFromIAccessible(
  [in]  IAccessible               *pAccessible,
  [in]  long                      idChild,
  [in]  DWORD                     dwFlags,
  [out] IRawElementProviderSimple **ppProvider
);

Parameters

[in] pAccessible

Type: IAccessible*

A pointer to the Microsoft Active Accessibility object.

[in] idChild

Type: long

The child ID of the Microsoft Active Accessibility object.

[in] dwFlags

Type: DWORD

One of the following values:

UIA_PFIA_DEFAULT

UIA_PFIA_UNWRAP_BRIDGE

[out] ppProvider

Type: IRawElementProviderSimple**

The new UI Automation provider.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

UI Automation provides backward compatibility for Microsoft Active Accessibility providers by supplying a proxy for them, called the Microsoft Active Accessibility to UI Automation proxy. This proxy is created automatically when a window responds to a WM_GETOBJECT message by returning a Microsoft Active Accessibility provider. Use UiaProviderFromIAccessible when you need to create a Microsoft Active Accessibility to UI Automation proxy manually; for example, when implementing the IAccessibleEx interface.

Some properties, such as LabeledBy, must be expressed as a UI Automation provider. An IAccessibleEx provider can use UiaProviderFromIAccessible to wrap an IAccessible object to return it as the value of the LabeledBy property.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header uiautomationcoreapi.h
Library Uiautomationcore.lib
DLL Uiautomationcore.dll

See also

Functions for Providers

UiaIAccessibleFromProvider