ITextRange::GetPoint method

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_TOPTop edge of the bounding rectangle.
TA_BASELINEBase line of the text.
TA_BOTTOMBottom edge of the bounding rectangle.

 

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

TA_LEFTLeft edge of the bounding rectangle.
TA_CENTERCenter of the bounding rectangle.
TA_RIGHTRight 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 codeDescription
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

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Tom.h

DLL

Msftedit.dll

See also

Reference
ITextRange
SetPoint
Conceptual
Text Object Model
Other Resources
SetTextAlign

 

 

Show: