IUIAutomationTextRange::AddToSelection 方法 (uiautomationclient.h)

將文字範圍新增至控件中選取文字範圍的集合,該控件支持選取文字的多個不相鄰範圍。

Syntax

HRESULT AddToSelection();

傳回值

類型: HRESULT

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

備註

文字插入點會移至新選取的文字。 如果在代表空白 () 文字範圍的文字範圍物件上呼叫 AddToSelection ,則文字插入點會移至文字範圍的起點。

規格需求

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

另請參閱

IUIAutomationTextRange

IUIAutomationTextRange::Select

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