IUIAutomationElement::GetRuntimeId Method

Retrieves the unique identifier assigned to the user interface (UI) element.


HRESULT GetRuntimeId(          SAFEARRAY *runtimeId[int]


[out, retval] The address of a SAFEARRAY that receives the runtime ID as an array of integers.

Return Value

Returns S_OK if successful, or an error value otherwise.


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 future releases. The returned identifier should be treated as an opaque value and used only for comparison; for example, to determine whether a UI Automation element is in the cache.

See Also

Community Additions