ITfContextView::GetRangeFromPoint method
The ITfContextView::GetRangeFromPoint method converts a point, in screen coordinates, to an empty range of text positioned at a corresponding location.
Syntax
HRESULT GetRangeFromPoint( [in] TfEditCookie ec, [in] const POINT *ppt, [in] DWORD dwFlags, [out] ITfRange **ppRange );
Parameters
- ec [in]
-
Specifies the edit cookie with read-only access.
- ppt [in]
-
Specifies the point in screen coordinates.
- dwFlags [in]
-
Specifies the range position to return based upon the screen coordinates of the point to a character bounding box. By default, the range position returned is the character bounding box containing the screen coordinates of the point. If the point is outside a character bounding box, the method returns NULL or TF_E_INVALIDPOINT. Other bit flags for this parameter are as follows.
The bit flags can be combined.
- ppRange [out]
-
Receives a pointer to the ITfRange interface.
Return value
This method can return one of these values.
| Value | Description |
|---|---|
|
The method was successful. |
|
The pptScreen parameter does not cover any document text. |
|
The application has not calculated a text layout. |
|
The specified edit cookie is invalid. |
Remarks

By default, the method will return a range positioned at 0 for point 1 and TF_E_INVALIDPOINT for point 2. If the dwFlags parameter is set to GXFPF_ROUND_NEAREST, the method returns range position 1 for point 1. If the dwFlags parameter is set to GXFPF_NEAREST then the method returns range position 2 for point 2.
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps | Windows Store apps] |
|
Redistributable |
TSF 1.0 on Windows 2000 Professional |
|
Header |
|
|
IDL |
|
|
DLL |
|
See also
- ITfContextView
- GXFPF_NEAREST
- GXFPF_ROUND_NEAREST
- TF_E_INVALIDPOINT