共用方式為


IUIAutomationTextRange::CompareEndpoints 方法 (uiautomationclient.h)

擷取值,指定這個文字範圍的開始或結束端點是否與另一個文字範圍的開始或結束端點相同。

語法

HRESULT CompareEndpoints(
  [in]          TextPatternRangeEndpoint srcEndPoint,
  [in]          IUIAutomationTextRange   *range,
  [in]          TextPatternRangeEndpoint targetEndPoint,
  [out, retval] int                      *compValue
);

參數

[in] srcEndPoint

類型: TextPatternRangeEndpoint

值,指出要比較此文字範圍的開始或結束端點。

[in] range

類型: IUIAutomationTextRange*

要比較之文字範圍的指標。

[in] targetEndPoint

類型: TextPatternRangeEndpoint

值,指出要比較 範圍的 開始或結束端點。

[out, retval] compValue

類型: int*

如果呼叫端的端點比目標端點早於文字中發生,則會收到負值;如果呼叫端的端點與目標端點位於相同的位置,則為 0;如果呼叫端的端點晚於文字中發生,則為正值,而不是目標端點。

傳回值

類型: HRESULT

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

規格需求

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

另請參閱

IUIAutomationTextRange

使用者介面自動化 文字內容的支援