ITfContextView::GetTextExt method (msctf.h)

The ITfContextView::GetTextExt method returns the bounding box, in screen coordinates, of a range of text.

Syntax

HRESULT GetTextExt(
  [in]  TfEditCookie ec,
  [in]  ITfRange     *pRange,
  [out] RECT         *prc,
  [out] BOOL         *pfClipped
);

Parameters

[in] ec

Specifies an edit cookie with read-only access.

[in] pRange

Specifies the range to query

[out] prc

Receives the bounding box, in screen coordinates, of the range.

[out] pfClipped

Receives the Boolean value that specifies if the text in the bounding box has been clipped. If this parameter is TRUE, the bounding box contains clipped text and does not include the entire requested range. The bounding box is clipped because of the requested range is not visible.

Return value

This method can return one of these values.

Value Description
S_OK
The method was successful.
TS_E_NOLAYOUT
The text is not rendered or the context has not calculated the text layout.
TF_E_NOLOCK
The edit cookie parameter is invalid.

Remarks

If the document window is minimized, or if the specified text is not currently visible, the method returns S_OK with the prc parameter set to {0,0,0,0}.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header msctf.h
DLL Msctf.dll
Redistributable TSF 1.0 on Windows 2000 Professional

See also

ITfContextOwner::GetTextExt

ITfContextView