IUIAutomation::CreateAndConditionFromArray 方法 (uiautomationclient.h)

创建一个条件,该条件基于多个条件选择元素,所有这些条件都必须为 true。

语法

HRESULT CreateAndConditionFromArray(
  [in]          SAFEARRAY              *conditions,
  [out, retval] IUIAutomationCondition **newCondition
);

参数

[in] conditions

类型: SAFEARRAY*

指向要组合的条件的指针。

[out, retval] newCondition

类型: IUIAutomationCondition**

接收指向组合条件的指针。

返回值

类型: HRESULT

如果该方法成功,则返回 S_OK。 否则,将返回 HRESULT 错误代码。

注解

此方法对条件数组中的每个指针调用 AddRef。 这意味着,可以在调用 CreateAndConditionFromArray 返回后对这些指针调用 Release,而不会使 CreateAndConditionFromArray 返回的指针失效。 对从 CreateAndConditionFromArray 返回的指针调用 Release 时,UI 自动化对条件数组中的每个指针调用 Release

要求

要求
最低受支持的客户端 Windows 7、带 SP2 的 Windows Vista 和适用于 Windows Vista 的平台更新、带 SP3 的 Windows XP 和适用于 Windows Vista 的平台更新 [仅限桌面应用]
最低受支持的服务器 Windows Server 2008 R2、Windows Server 2008 SP2 和 Platform Update for Windows Server 2008、Windows Server 2003 SP2 和 Platform Update for Windows Server 2008 [仅限桌面应用]
目标平台 Windows
标头 uiautomationclient.h (包括 UIAutomation.h)

另请参阅

使用安全数组的最佳做法

概念性

CreateAndCondition

CreateAndConditionFromNativeArray

FindAll

FindAllBuildCache

FindFirst

FindFirstBuildCache

IUIAutomation

IUIAutomationCondition

引用