IRawElementProviderFragment.GetRuntimeId Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves the runtime identifier of an element.
public:
cli::array <int> ^ GetRuntimeId();
public int[] GetRuntimeId();
abstract member GetRuntimeId : unit -> int[]
Public Function GetRuntimeId () As Integer()
The unique run-time identifier of the element.
The following example code shows an implementation of this method by an element within a fragment, such as an item within a list box. The item has its own unique identifier within this instance of the fragment, and the AppendRuntimeId value ensures that the identifier returned by the method is unique in the UI Automation tree.
/// <summary>
/// Gets the runtime identifier of the UI Automation element.
/// </summary>
/// <remarks>
/// myID is a unique identifier for the item within this instance of the list.
/// </remarks>
public int[] GetRuntimeId()
{
return new int[] { AutomationInteropProvider.AppendRuntimeId, myID };
}
''' <summary>
''' Gets the runtime identifier of the UI Automation element.
''' </summary>
''' <remarks>
''' myID is a unique identifier for the item within this instance of the list.
''' </remarks>
Public Function GetRuntimeId() As Integer() _
Implements IRawElementProviderFragment.GetRuntimeId
Return New Integer() {AutomationInteropProvider.AppendRuntimeId, myID}
End Function 'GetRuntimeId
Implementations should return null
for an element that corresponds to a window handle. Other elements should return an array that contains AppendRuntimeId, followed by a value that is unique within the fragment.
It is the provider's responsibility to ensure uniqueness within the fragment; for example, each item in a list must be individually numbered. The UI Automation engine ensures that the identifier is unique among all instances, by translating the AppendRuntimeId value.
Product | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: