IDWriteTextAnalysisSource::GetTextBeforePosition method

Gets a block of text immediately preceding the specified position.

Syntax


virtual HRESULT GetTextBeforePosition(
              UINT32 textPosition,
  [out] const WCHAR  **textString,
  [out]       UINT32 *textLength
) = 0;

Parameters

textPosition

Type: UINT32

The position immediately after the last position of the block of text to obtain.

textString [out]

Type: const WCHAR**

When this method returns, contains an address of a pointer to the block of text, as an array of characters from the specified range. The text range will be from textPosition to the front of the block.

textLength [out]

Type: UINT32*

Number of UTF16 units of the retrieved block. The length returned is from the specified position to the front of the block.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

NULL indicates no chunk available at the specified position, either because textPosition equals 0, textPosition is greater than the entire text content length, or the queried position is not mapped into the application's backing store.

Although applications can implement sparse textual content that maps only part of the backing store, the application must map any text that is in the range passed to any analysis functions.

Requirements

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

Dwrite.h

Library

Dwrite.lib

DLL

Dwrite.dll

See also

IDWriteTextAnalysisSource

 

 

Show: