IUIAutomationElement::GetCachedChildren method (uiautomationclient.h)

Retrieves the cached child elements of this UI Automation element.

Syntax

HRESULT GetCachedChildren(
  [out, retval] IUIAutomationElementArray **children
);

Parameters

[out, retval] children

Type: IUIAutomationElementArray**

Receives a pointer to a collection of the cached child elements.

Return value

Type: HRESULT

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

Remarks

The view of the returned collection is determined by the TreeFilter property of the IUIAutomationCacheRequest that was active when this element was obtained.

Children are cached only if the scope of the cache request included TreeScope_Subtree, TreeScope_Children, or TreeScope_Descendants.

If the cache request specified that children were to be cached at this level, but there are no children, the value of this property is 0. However, if no request was made to cache children at this level, an attempt to retrieve the property returns an 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

GetCachedParent

IUIAutomationElement

Obtaining UI Automation Elements

Reference

UI Automation Tree Overview