Share via


UiaLookupId Function

Note  This function is deprecated. Client applications should use the Microsoft UI Automation COM interfaces instead.

Gets the integer identifier that can be used in methods that require a PROPERTYID, PATTERNID, CONTROLTYPEID, TEXTATTRIBUTEID, or EVENTID.

Syntax

int UiaLookupId(      
    AutomationIdentifierType type,
    GUID *pGuid
);

Parameters

  • type
    [in] A value from the AutomationIdentifierType enumerated type that specifies the type of identifier to look up.
  • pGuid
    [in] The address of the unique identifier of the property, pattern, control type, text attribute, or event.

Return Value

Returns an integer identifier.

Example

The following example function declares and populates a structure that contains identifiers for two properties, a pattern, and a control type.

struct UiaIdentifiers
{
    PROPERTYID NameProperty;
    PROPERTYID ControlTypeProperty;
    PATTERNID  InvokePattern;
    CONTROLTYPEID ButtonControlType;
} UiaIds;

void Provider::InitIds()
{
    static bool inited = false;
    if (!inited)
    {
        inited = true;
        UiaIds.NameProperty = UiaLookupId(AutomationIdentifierType_Property, &Name_Property_GUID);
        UiaIds.ControlTypeProperty = UiaLookupId(AutomationIdentifierType_Property, &ControlType_Property_GUID);
        UiaIds.InvokePattern = UiaLookupId(AutomationIdentifierType_Pattern, &Invoke_Pattern_GUID);
        UiaIds.ButtonControlType = UiaLookupId(AutomationIdentifierType_ControlType, &Button_Control_GUID);
    }
}

Function Information

Stock Implementation uiautomationcore.dll
Custom Implementation No
Header uiautomationcoreapi.h
Import library uiautomationcore.lib
Minimum operating systems Windows XP

See Also

Property Identifiers, GUIDs