共用方式為


IUIAutomationElement::GetCachedChildren 方法 (uiautomationclient.h)

擷取這個 使用者介面自動化 專案的快取子專案。

語法

HRESULT GetCachedChildren(
  [out, retval] IUIAutomationElementArray **children
);

參數

[out, retval] children

類型: IUIAutomationElementArray**

接收快取子專案集合的指標。

傳回值

類型: HRESULT

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

備註

傳回之集合的檢視是由取得這個專案時使用中 之 IUIAutomationCacheRequest 的 TreeFilter 屬性所決定。

只有在包含快取要求的範圍 TreeScope_SubtreeTreeScope_ChildrenTreeScope_Descendants時,才會快取子系。

如果快取要求指定要在此層級快取子系,但沒有子系,則此屬性的值為 0。 不過,如果沒有要求在此層級快取子系,則嘗試擷取屬性會傳回錯誤。

規格需求

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

另請參閱

概念

GetCachedParent

IUIAutomationElement

取得 UI 自動化項目

參考

UI 自動化樹狀目錄概觀