ITextProvider::RangeFromChild method

Retrieves a text range enclosing a child element such as an image, hyperlink, or other embedded object.

Syntax

HRESULT RangeFromChild(
  IRawElementProviderSimple *childElement,
  ITextRangeProvider        **pRetVal
);

Parameters

childElement

Type: IRawElementProviderSimple*

The address of the UI Automation provider interface for the enclosed UI Automation object.

pRetVal

Type: ITextRangeProvider**

Receives a pointer to the text range that spans the child element. This parameter is passed uninitialized.

Return Value

Type: HRESULT

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

Remarks

A provider should check that the passed element is a child of the text container.

If there is no text in the text range where the child element exists, a degenerate (empty) range is returned.

The childElement parameter is either a child of the UI Automation element associated with a TextPattern or from the array of children of an ITextRangeProvider.

Requirements

   
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header uiautomationcore.h (include UIAutomation.h)

See Also

Conceptual

ITextProvider

ITextRangeProvider

Reference

UI Automation Providers Overview