Export (0) Print
Expand All

IUIAutomationTreeWalker::GetParentElementBuildCache Method

Retrieves the parent element of the specified UI Automation element, and caches properties and control patterns.


HRESULT GetParentElementBuildCache(          IUIAutomationElement *element,
    IUIAutomationCacheRequest *cacheRequest,
    IUIAutomationElement **parent


[in] The address of the IUIAutomationElement interface of the element for which to retrieve the parent.
[in] The address of the IUIAutomationCacheRequest interface of a cache request that specifies the properties and control patterns to cache on the returned element.
[out, retval] The address of a variable that receives a pointer to the IUIAutomationElement interface of parent element, or NULL if there is no parent element.

Return Value

Returns S_OK if successful, or an error value otherwise.


The structure of the Microsoft UI Automation tree changes as the visible UI elements on the desktop change. It is not guaranteed that an element returned as the parent element will be returned as the parent on subsequent passes.

Community Additions

© 2014 Microsoft