共用方式為


IUIAutomationTreeWalker::GetNextSiblingElement 方法 (uiautomationclient.h)

擷取指定之 使用者介面自動化 專案的下一個同層級專案。

語法

HRESULT GetNextSiblingElement(
  [in]          IUIAutomationElement *element,
  [out, retval] IUIAutomationElement **next
);

參數

[in] element

類型: IUIAutomationElement*

要擷取下一個同層級之專案的指標。

[out, retval] next

類型: IUIAutomationElement**

接收下一個同層級專案的指標,如果沒有同層級專案,則為 NULL

傳回值

類型: HRESULT

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

備註

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

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

規格需求

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