Share via


CoreAutomationRegistrar.RegisterAnnotationType(Guid) Method

Definition

Registers a custom annotation type for text ranges.

public:
 static AutomationAnnotationTypeRegistration RegisterAnnotationType(Platform::Guid guid);
 static AutomationAnnotationTypeRegistration RegisterAnnotationType(winrt::guid const& guid);
public static AutomationAnnotationTypeRegistration RegisterAnnotationType(Guid guid);
function registerAnnotationType(guid)
Public Shared Function RegisterAnnotationType (guid As Guid) As AutomationAnnotationTypeRegistration

Parameters

guid
Guid

Platform::Guid

winrt::guid

The GUID that represents the custom annotation type. This must be the same as the GUID used by the UI Automation provider.

Returns

An object that provides an ID corresponding to the GUID registered for use in other UIA APIs that require an annotation ID.

Remarks

Both the UI Automation (UIA) provider and client call this method to register a custom annotation type. The guid must be the same for both.

The same annotation type GUID can be registered more than once on the same process. An identical registration is returned if called on a GUID that is already registered. UnregisterAnnotationType(Windows.UI.UIAutomation.Core.AutomationAnnotationTypeRegistration) must still be called once for each call to this method, even if the same GUID is registered multiple times.

An annotation type registration lasts as long as the process for which it was registered or until UnregisterAnnotationType(Windows.UI.UIAutomation.Core.AutomationAnnotationTypeRegistration) is called.

Applies to