IUIAutomationCacheRequest::get_AutomationElementMode 方法 (uiautomationclient.h)

指出傳回的專案是否包含基礎 UI 的完整參考,或只包含快取的資訊。

這是可讀寫的屬性。

語法

HRESULT get_AutomationElementMode(
  AutomationElementMode *mode
);

參數

mode

傳回值

備註

AutomationElementMode_Full 是預設值,並指定傳回的專案包含基礎 UI 的完整參考。 AutomationElementMode_None 指定傳回的專案沒有基礎 UI 的參考,而且只包含快取的資訊。

元素上的某些作業,包括 GetCurrentPropertyValueSetFocus都需要完整參考;嘗試在沒有任何專案上執行這些動作會導致錯誤。

當只需要屬性時,使用 AutomationElementMode_None 可能會更有效率,因為它可避免設定完整參考時的額外負荷。

規格需求

   
最低支援的用戶端 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)