IUIAutomationElement::GetCurrentPatternAs method (uiautomationclient.h)

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

Syntax

HRESULT GetCurrentPatternAs(
  [in]  PATTERNID patternId,
  [in]  REFIID    riid,
  [out] void      **patternObject
);

Parameters

[in] patternId

Type: PATTERNID

The identifier of the control pattern. For a list of control pattern IDs, see Control Pattern Identifiers.

[in] riid

Type: REFIID

A reference to the IID of the interface to retrieve through ppv.

[out] patternObject

Type: void**

Receives the interface pointer requested in riid.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

It is recommended that you use the IID_PPV_ARGS macro, defined in Objbase.h, to package the riid and ppv parameters. This macro provides the correct IID based on the interface pointed to by the value in ppv, which eliminates the possibility of a coding error.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista, Windows XP with SP3 and Platform Update for Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008, Windows Server 2003 with SP2 and Platform Update for Windows Server 2008 [desktop apps only]
Target Platform Windows
Header uiautomationclient.h (include UIAutomation.h)

See also

Conceptual

GetCachedPatternAs

GetCurrentPattern

IUIAutomationElement

Reference

UI Automation Control Patterns Overview