IUIAutomationElement::GetRuntimeId method

Retrieves the unique identifier assigned to the UI element.

Syntax

HRESULT GetRuntimeId(
  SAFEARRAY **runtimeId
);

Parameters

runtimeId

Type: SAFEARRAY**

Receives a pointer to the runtime ID as an array of integers.

Return Value

Type: HRESULT

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

Remarks

The identifier is only guaranteed to be unique to the UI of the desktop on which it was generated. Identifiers can be reused over time.

The format of run-time identifiers might change in the future. The returned identifier should be treated as an opaque value and used only for comparison; for example, to determine whether a Microsoft UI Automation element is in the cache.

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

Automation Element Property IDs

Best Practices for Using Safe Arrays

CompareRuntimeIds

Conceptual

IUIAutomationElement

Reference