Share via


IUIAutomationElement::GetCachedChildren Method

Retrieves the cached child elements of this UI Automation element.

Syntax

HRESULT GetCachedChildren(      
    IUIAutomationElementArray **children
);

Parameters

  • children
    [out, retval] The address of a variable that receives a pointer to an IUIAutomationElementArray interface that represents the collection of the cached children.

Return Value

Returns S_OK if successful, or an error value otherwise.

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.

See Also

IUIAutomationElement, IUIAutomationElement::GetCachedParent, Obtaining UI Automation Elements, UI Automation Tree Overview