IUIAutomationTextRange3::GetEnclosingElementBuildCache method (uiautomationclient.h)

Gets the enclosing element and supplied properties and patterns for an element in a text range in a single cross-process call. This is equivalent to calling GetEnclosingElement, but adds the standard build cache pattern.

Syntax

HRESULT GetEnclosingElementBuildCache(
  IUIAutomationCacheRequest *cacheRequest,
  IUIAutomationElement      **enclosingElement
);

Parameters

cacheRequest

An IUIAutomationCacheRequest specifying the properties and control patterns to be cached.

enclosingElement

Returns the enclosing element (and properties/patterns) of the text range if it meets the criteria of the supplied cacheRequest.

Return value

Returns S_OK if successful, otherwise an HRESULT error code.

Remarks

Following the design of GetEnclosingElement:

  • Gets the all-inclusive, innermost enclosing element of a text range and the supplied properties of the element.
As a result of a successful call, UI Automation clients are able call "Cached" APIs of IUIAutomationElement that are provided in the cacheRequest, for example, IUIAutomationElement::GetCachedPropertyValue.

Requirements

   
Minimum supported client Windows 10, version 1703 [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header uiautomationclient.h (include UIAutomation.h)

See also

IUIAutomationTextRange3

UI Automation Support for Textual Content