IUIAutomationElement7::FindFirstWithOptionsBuildCache method (uiautomationclient.h)

Finds the first matching element in the specified order, but also caches its properties and pattern.

Syntax

HRESULT FindFirstWithOptionsBuildCache(
  [in]           TreeScope                 scope,
  [in]           IUIAutomationCondition    *condition,
  [in]           IUIAutomationCacheRequest *cacheRequest,
                 TreeTraversalOptions      traversalOptions,
  [in, optional] IUIAutomationElement      *root,
  [out, retval]  IUIAutomationElement      **found
);

Parameters

[in] scope

A combination of values specifying the scope of the search.

[in] condition

A pointer to a condition that represents the criteria to match.

[in] cacheRequest

A pointer to a cache request that specifies the control patterns and properties to include in the cache.

traversalOptions

Enumeration value specifying the tree navigation order.

[in, optional] root

A pointer to the element with which to begin the search.

[out, retval] found

Receives a pointer to the element. NULL is returned if no matching element is found.

Return value

Returns S_OK if successful, otherwise an HRESULT error code.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1703 [desktop apps only]
Minimum supported server Windows Server 2016 [desktop apps only]
Target Platform Windows
Header uiautomationclient.h (include UIAutomation.h)
DLL UIAutomationCore.dll

See also

IUIAutomationElement7