ITextRange2::GetRect method (tom.h)

Retrieves a rectangle of the specified type for the current range.

Syntax

HRESULT GetRect(
  [in]  long Type,
  [out] long *pLeft,
  [out] long *pTop,
  [out] long *pRight,
  [out] long *pBottom,
  [out] long *pHit
);

Parameters

[in] Type

Type: long

The type of rectangle to return. This parameter can include one value from each of the following tables.

tomAllowOffClient

tomClientCoord

tomObjectArg

tomTransform

Use one of these 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 these 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.

[out] pLeft

Type: long*

The left rectangle coordinate.

[out] pTop

Type: long*

The top rectangle coordinate.

[out] pRight

Type: long*

The right rectangle coordinate.

[out] pBottom

Type: long*

The bottom rectangle coordinate.

[out] pHit

Type: long*

The hit-test value for the range.

Return value

Type: HRESULT

If the method succeeds, it returns NOERROR. Otherwise, it returns an HRESULT error code.

Requirements

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

See also

ITextRange2