EM_POSFROMCHAR

 

Description

 

Retrieves the client area coordinates of a specified character in a rich edit control. You can send this message explicitly or use the RichEdit_PosFromChar function.

 

C/C++ Syntax

 

To send this message, call the SendMessage function as follows.

 

lResult = SendMessage(

(HWND) hWndControl,      // control handle

(UINT) EM_POSFROMCHAR,   // message ID

(WPARAM) wParam,

(LPARAM) lParam

);

 

PB Syntax

 

lResult = SendMessage( _

hWndControl, _          ' control handle

%EM_POSFROMCHAR, _      ' message ID

wParam, _

lParam _

)

 

Parameters

 

wParam

Rich Edit 1.0 and 3.0: A pointer to a POINTL structure that receives the client area coordinates of the character. The coordinates are in screen units and are relative to the upper-left corner of the control's client area.

Rich Edit 2.0: The zero-based index of the character.

lParam

Rich Edit 1.0 and 3.0: The zero-based index of the character.

Rich Edit 2.0: This parameter is not used.

 

Return value

 

Rich Edit 1.0 and 3.0: The return value is not used.

 

Rich Edit 2.0: The return value contains the client area coordinates of the character. The low-order word contains the horizontal coordinate and the high-order word contains the vertical coordinate.

 

Remarks

 

A returned coordinate can be a negative value if the specified character is not displayed in the edit control's client area. The coordinates are truncated to integer values.

 

If the character is a line delimiter, the returned coordinates indicate a point just beyond the last visible character in the line. If the specified index is greater than the index of the last character in the control, the control returns -1.

 

Rich Edit 3.0 and later: For backward compatibility, Microsoft Rich Edit 3.0 supports the syntax used by Rich Edit 2.0. If Rich Edit 3.0 detects that wParam is not a valid POINTL pointer, it assumes the message was sent using the Rich Edit 2.0 syntax. In this case, it uses the return value to return the coordinates.

 

Supported in Rich Edit 1.0 and later.

 

Minimum Operating System

 

Windows 95, Windows NT 4.0.

 

Valid XHTML 1.0 Transitional