ITextRangeProvider::GetChildren method (uiautomationcore.h)

Retrieves a collection of all elements that are both contained (either partially or completely) within the specified text range, and are child elements of the enclosing element for the specified text range.

Syntax

HRESULT GetChildren(
  [out, retval] SAFEARRAY **pRetVal
);

Parameters

[out, retval] pRetVal

Type: SAFEARRAY**

An array of pointers to the IRawElementProviderSimple interfaces for all child elements that are enclosed by the text range (sorted by the Start endpoint of their ranges).

If the text range does not include any child elements, an empty collection is returned.

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

Each element retrieved with ITextRangeProvider::GetChildren has a valid text range that can be retrieved through RangeFromChild. This includes any elements in the UI Automation tree between the ITextProvider and the child element.

Examples

  1. This example shows a text stream that contains an image link. The link is a child of the image, but both span the same text range and are exposed as embedded objects within the text stream.

    Hello <Image Link> World

  2. This example shows a text stream that contains a two-cell table surrounded by text.

    Start text

    Table Cell 1Table Cell 2

    End Text

Requirements

Requirement Value
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

ITextProvider, ITextRangeProvider, GetEnclosingElement, ITextProvider::RangeFromChild, UI Automation Providers Overview, Best Practices for Using Safe Arrays