共用方式為


IUIAutomation::CompareRuntimeIds 方法 (uiautomationclient.h)

比較兩個包含運行時間標識碼的整數數位列, (標識碼) ,以判斷其內容是否相同,而且它們屬於相同的UI元素。

語法

HRESULT CompareRuntimeIds(
  [in]          SAFEARRAY *runtimeId1,
  [in]          SAFEARRAY *runtimeId2,
  [out, retval] BOOL      *areSame
);

參數

[in] runtimeId1

類型: SAFEARRAY*

要比較的第一個標識碼。

[in] runtimeId2

類型: SAFEARRAY*

要比較的第二個標識碼

[out, retval] areSame

類型: BOOL*

如果標識符相同,則會收到 TRUE ,否則為 FALSE

傳回值

類型: HRESULT

如果此方法成功,則會傳回 S_OK。 否則,它會傳回 HRESULT 錯誤碼。

規格需求

需求
最低支援的用戶端 Windows 7、Windows Vista sp2 和 Platform Update for Windows Vista、Windows XP with SP3 和 Platform Update for 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)

另請參閱

使用安全數位的最佳做法

CompareElements

概念

GetRuntimeId

IUIAutomation

參考