IUIAutomationTreeWalker::GetParentElementBuildCache Method
Retrieves the parent element of the specified UI Automation element, and caches properties and control patterns.
Syntax
HRESULT GetParentElementBuildCache( IUIAutomationElement *element, IUIAutomationCacheRequest *cacheRequest, IUIAutomationElement **parent );
Parameters
- element
[in] The address of the IUIAutomationElement interface of the element for which to retrieve the parent.- cacheRequest
[in] The address of the IUIAutomationCacheRequest interface of a cache request that specifies the properties and control patterns to cache on the returned element.- parent
[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.
Remarks
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.