ITextRange::GetPoint method (tom.h)

Retrieves screen coordinates for the start or end character position in the text range, along with the intra-line position.

Syntax

HRESULT GetPoint(
  long Type,
  long *px,
  long *py
);

Parameters

Type

Type: long

Flag that indicates the position to retrieve. This parameter can include one value from each of the following tables. The default value is tomStart + TA_BASELINE + TA_LEFT.

tomAllowOffClient

tomClientCoord

tomObjectArg

tomTransform

Use one of the following values to indicate the start or end of the range.

tomStart

tomEnd

Use one of the following values to indicate the vertical position.

TA_TOP Top edge of the bounding rectangle.
TA_BASELINE Base line of the text.
TA_BOTTOM Bottom edge of the bounding rectangle.
 

Use one of the following values to indicate the horizontal position.

TA_LEFT Left edge of the bounding rectangle.
TA_CENTER Center of the bounding rectangle.
TA_RIGHT Right edge of the bounding rectangle.

px

Type: long*

The x-coordinate.

py

Type: long*

The y-coordinate.

Return value

Type: HRESULT

The method returns an HRESULT value. If the method succeeds, it returns S_OK. If the method fails, it returns one of the following error codes. For more information about COM error codes, see Error Handling in COM.

Return code Description
E_INVALIDARG
Either px or py is null.
S_FALSE
Failure for some other reason.

Remarks

The ITextRange::GetPoint method gives ITextRange the ability to emulate UI-pointer commands; it is also handy for accessibility purposes.

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

ITextRange

Other Resources

Reference

SetPoint

SetTextAlign

Text Object Model