IUIAutomation::ElementFromIAccessible method (uiautomationclient.h)

Retrieves a UI Automation element for the specified accessible object from a Microsoft Active Accessibility server.

Syntax

HRESULT ElementFromIAccessible(
  IAccessible          *accessible,
  int                  childId,
  IUIAutomationElement **element
);

Parameters

accessible

Type: IAccessible*

A pointer to the IAccessible interface of the accessible object.

childId

Type: int

The child ID of the accessible object.

element

Type: IUIAutomationElement**

Receives a pointer to the UI Automation element.

Return value

Type: HRESULT

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

Remarks

This method enables UI Automation clients to get IUIAutomationElement interfaces for accessible objects implemented by a Microsoft Active Accessiblity server.

This method may fail if the server implements UI Automation provider interfaces alongside Microsoft Active Accessibility support.

The method returns E_INVALIDARG if the underlying implementation of the Microsoft UI Automation element is not a native Microsoft Active Accessibility server; that is, if a client attempts to retrieve the IAccessible interface for an element originally supported by a proxy object from Oleacc.dll, or by the UIA-to-MSAA Bridge.

Requirements

   
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista, Windows XP with SP3 and Platform Update for Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008, Windows Server 2003 with SP2 and Platform Update for Windows Server 2008 [desktop apps only]
Target Platform Windows
Header uiautomationclient.h (include UIAutomation.h)

See also

IUIAutomation

IUIAutomation::ElementFromHandleBuildCache