TextRange_GetText function

Note  This function is deprecated. Client applications should use the Microsoft UI Automation Component Object Model (COM) interfaces instead.
 

Returns the text in a text range, up to a specified number of characters.

Syntax


HRESULT TextRange_GetText(
  _In_  HUIATEXTRANGE hobj,
  _In_  int           maxLength,
  _Out_ BSTR          *pRetVal
);

Parameters

hobj [in]

Type: HUIATEXTRANGE

A text range object.

maxLength [in]

Type: int

The number of characters to return, beginning with the character at the starting endpoint of the text range.

pRetVal [out]

Type: BSTR*

When this function returns, this parameter contains a pointer to the returned text. This parameter is passed uninitialized.

Return value

Type: HRESULT

Returns S_OK if successful or an error value otherwise.

Remarks

If maxLength is -1, all of the text within the text range is returned. If maxLength is larger than the length of the text range, the returned string contains all of the text in the text range.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

UIAutomationCoreApi.h

Library

Uiautomationcore.lib

DLL

Uiautomationcore.dll

 

 

Show: