IUIAutomationTreeWalker::GetPreviousSiblingElement 方法 (uiautomationclient.h)

擷取指定之 UI 自動化專案的上一個同層級專案。

語法

HRESULT GetPreviousSiblingElement(
  [in]          IUIAutomationElement *element,
  [out, retval] IUIAutomationElement **previous
);

參數

[in] element

類型: IUIAutomationElement*

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

[out, retval] previous

類型: IUIAutomationElement**

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

傳回值

類型: HRESULT

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

備註

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

Microsoft UI 自動化樹狀結構會隨著桌面上的可見 UI 元素變更而變更。 不保證傳回為上一個同層級元素的專案會在後續階段傳回為上一個同層級專案。

規格需求

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