Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IRawElementProviderSimple::GetPatternProvider method

Retrieves a pointer to an object that provides support for a control pattern on a Microsoft UI Automation element.

Syntax


HRESULT GetPatternProvider(
  [in]          PATTERNID patternId,
  [out, retval] IUnknown  **pRetVal
);

Parameters

patternId [in]

Type: PATTERNID

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

pRetVal [out, retval]

Type: IUnknown**

Receives a pointer to the object that supports the control pattern, or NULL if the control pattern is not supported. This parameter is passed uninitialized.

Return value

Type: HRESULT

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

Examples

The following example shows how to return a control pattern provider. In this case, the provider is implemented by the class that implements IRawElementProviderSimple::GetPatternProvider. The UiaIds structure was previously populated by using UiaLookupId.



HRESULT STDMETHODCALLTYPE Provider::GetPatternProvider(PATTERNID patternId, IUnknown** pRetVal)
{
    if (patternId == UiaIds.InvokePattern)
    {
        AddRef();
        *pRetVal =(IUnknown *)(IRawElementProviderSimple*)this;
    }
    else
    {
        *pRetVal = NULL;   
    }
    return S_OK;
}
            

Requirements

Minimum supported client

Windows XP [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2003 [desktop apps | Windows Store apps]

Header

UIAutomationCore.h (include UIAutomation.h)

IDL

UIAutomationCore.idl

See also

IRawElementProviderSimple

 

 

Show:
© 2017 Microsoft