共用方式為


IUIAutomationTreeWalker::GetFirstChildElementBuildCache 方法 (uiautomationclient.h)

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

語法

HRESULT GetFirstChildElementBuildCache(
  [in]          IUIAutomationElement      *element,
  [in]          IUIAutomationCacheRequest *cacheRequest,
  [out, retval] IUIAutomationElement      **first
);

參數

[in] element

類型: IUIAutomationElement*

要擷取第一個子專案的指標。

[in] cacheRequest

類型: IUIAutomationCacheRequest*

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

[out, retval] first

類型: IUIAutomationElement**

接收第一個子專案的指標,如果沒有子專案,則為 Null

傳回值

類型: HRESULT

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

備註

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

Microsoft UI 自動化樹狀結構會隨著桌面上的可見 UI 元素變更而變更。 不保證當做第一個子項目傳回的專案,將會在後續傳遞時當做第一個子系傳回。

規格需求

   
最低支援的用戶端 Windows 7、Windows Vista SP2 和 Platform Update for Windows Vista、Windows XP 含 SP3 和適用于 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)