共用方式為


IUIAutomationTreeWalker::GetLastChildElementBuildCache 方法 (uiautomationclient.h)

擷取指定之 使用者介面自動化 元素的最後一個子專案,並快取屬性和控制模式。

語法

HRESULT GetLastChildElementBuildCache(
  [in]          IUIAutomationElement      *element,
  [in]          IUIAutomationCacheRequest *cacheRequest,
  [out, retval] IUIAutomationElement      **last
);

參數

[in] element

類型: IUIAutomationElement*

要擷取最後一個子系之專案的指標。

[in] cacheRequest

類型: IUIAutomationCacheRequest*

快取要求的指標,指定要在傳回之專案上快取的屬性和控件模式。

[out, retval] last

類型: IUIAutomationElement**

接收最後一個子專案的指標,如果沒有子專案,則為 NULL

傳回值

類型: HRESULT

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

備註

專案可以有不符合目前檢視條件的其他子專案,因此在巡覽專案樹狀結構時不會傳回。

當桌面上的可見UI元素變更時,Microsoft 使用者介面自動化 樹狀結構會變更。 不保證當做最後一個子元素傳回的專案,將會在後續的傳遞中傳回最後一個子專案。

規格需求

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