TextRange_GetText Function

Note  This function is deprecated. Client applications should use the Microsoft UI Automation COM interfaces instead.

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

Syntax

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

Parameters

  • hobj
    [in] A text range object.
  • maxLength
    [in] The number of characters to return, starting at the start point of the text range.
  • pRetVal
    [out] When this function returns, contains a pointer to the returned text. This parameter is passed uninitialized.

Return Value

Returns S_OK if successful or an error value otherwise.

Remarks

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

Function Information

Stock Implementation uiautomationcore.dll
Custom Implementation No
Header uiautomationcoreapi.h
Import library uiautomationcore.lib
Minimum operating systems Windows XP