IUIAutomationElement::GetCurrentPropertyValue 方法 (uiautomationclient.h)

检索此 UI 自动化元素的属性的当前值。

语法

HRESULT GetCurrentPropertyValue(
  [in]          PROPERTYID propertyId,
  [out, retval] VARIANT    *retVal
);

参数

[in] propertyId

类型: PROPERTYID

属性的标识符。 有关属性 ID 的列表,请参阅 属性标识符

[out, retval] retVal

类型: VARIANT*

接收 属性的值。

返回值

类型: HRESULT

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

注解

精度类型的 Microsoft UI 自动化属性支持 Not a Number (NaN) 值。 检索 double 类型的属性时,客户端可以使用 _isnan 函数来确定该属性是否为 NaN 值。

要求

   
最低受支持的客户端 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)

请参阅

概念性

GetCachedPropertyValue

GetCurrentPropertyValueEx

IUIAutomationElement

引用

UI 自动化属性概述