ITextDocument::RangeFromPoint method (tom.h)

Retrieves a range for the content at or nearest to the specified point on the screen.

Syntax

HRESULT RangeFromPoint(
  long       x,
  long       y,
  ITextRange **ppRange
);

Parameters

x

Type: long

The horizontal coordinate of the specified point, in screen coordinates.

y

Type: long

The vertical coordinate of the specified point, in screen coordinates.

ppRange

Type: ITextRange**

The text range that corresponds to the specified point.

Return value

Type: HRESULT

If the method succeeds, it returns S_OK. If the method fails, it returns one of the following COM error codes. For more information on COM error codes, see Error Handling in COM.

Return code Description
E_INVALIDARG
Invalid argument.
E_OUTOFMEMORY
Insufficient memory.

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

Expand

GetPoint

ITextDocument

ITextRange

MoveStart

Reference

Text Object Model