Share via


IUIAutomationTextPattern::RangeFromChild 方法 (uiautomationclient.h)

擷取包含子元素的文字範圍,例如影像、超連結、Microsoft Excel 電子錶格或其他內嵌物件。

語法

HRESULT RangeFromChild(
  [in]          IUIAutomationElement   *child,
  [out, retval] IUIAutomationTextRange **range
);

參數

[in] child

類型: IUIAutomationElement*

要包含在文字範圍中的子專案的指標。

[out, retval] range

類型: IUIAutomationTextRange**

接收括住子專案的文字範圍指標。

傳回值

類型: HRESULT

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

備註

如果範圍中沒有包含子元素的文字,則會傳回 (空) 範圍。

參數是與 IUIAutomationTextPattern 相關聯的專案子系,或是從 IUIAutomationTextRange 的子係數位。

規格需求

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

另請參閱

IUIAutomationTextPattern

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