ITextRange::SetPoint method (tom.h)

Changes the range based on a specified point at or up through (depending on Extend) the point (x, y) aligned according to Type.

Syntax

HRESULT SetPoint(
  [in] long x,
  [in] long y,
  [in] long Type,
  [in] long Extend
);

Parameters

[in] x

Type: long

Horizontal coordinate of the specified point, in absolute screen coordinates.

[in] y

Type: long

Vertical coordinate of the specified point, in absolute screen coordinates.

[in] Type

Type: long

The end to move to the specified point. It can be one of the following.

tomStart Move the start of range.
tomEnd Move the end of range.

[in] Extend

Type: long

How to set the endpoints of the range. If Extend is zero (the default), the range is an insertion point at the specified point (or at the nearest point with selectable text). If Extend is 1, the end specified by Type is moved to the point and the other end is left alone.

Return value

Type: HRESULT

The method returns S_OK.

Remarks

An application can use the specified point in the WindowFromPoint function to get the handle of the window, which usually can be used to find the client-rectangle coordinates (although a notable exception is with Windowless Controls).

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header tom.h
DLL Msftedit.dll

See also

Conceptual

GetPoint

ITextRange

Reference

Text Object Model