Share via


IUIAutomationElement::GetCurrentPattern Method

Retrieves the IUnknown interface of the specified control pattern on this UI Automation element.

Syntax

HRESULT GetCurrentPattern(      
    PATTERNID patternId,
    IUnknown **patternObject
);

Parameters

  • patternId
    [in] The identifier of the control pattern. For a list of control pattern IDs, see Control Pattern Identifiers.
  • patternObject
    [out, retval] The address of a variable that receives a pointer to an IUnknown interface.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

This method gets the specified pattern based on its availability at the time of the call.

For some forms of UI, this method will incur cross-process performance overhead. Applications can reduce overhead by caching patterns and then retrieving them by using IUIAutomationElement::GetCachedPattern.

See Also

IUIAutomationElement, IUIAutomationElement::GetCachedPattern, IUIAutomationElement::GetCurrentPatternAs, UI Automation Control Patterns Overview