Share via


ITextRangeProvider::GetEnclosingElement Method

Returns the innermost control that encloses the text range.

Syntax

HRESULT GetEnclosingElement(      
    IRawElementProviderSimple **pRetVal
);

Parameters

  • pRetVal
    [out, retval] The address of a variable that receives a pointer to the IRawElementProviderSimple interface of the enclosing element. This parameter is passed uninitialized.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

The enclosing element is typically the text provider that supplies the text range. However, if the text provider supports child elements such as tables or hyperlinks, the enclosing element could be a descendant of the text provider.

See Also

UI Automation Providers Overview, ITextProvider