EM_POSFROMCHAR

An application sends the EM_POSFROMCHAR message to retrieve the coordinates of the specified character in an edit control.

EM_POSFROMCHAR 
wParam = (WPARAM) wCharIndex;    // zero-based index of character 
lParam = 0;                      // not used
 

Parameters

wCharIndex
Value of wParam. Specifies the zero-based index of the character.

Return Values

The return value is the position of the character, (x, y). For a single-line edit control, the y-coordinate is always zero.

Remarks

A returned coordinate can be negative if the character has been scrolled outside the edit control's client area. The coordinates are truncated to integer values.

If wCharIndex is the index of a line delimiter, the returned coordinates are of the position just past the last visible character in the line.

If wCharIndex is greater than the index of the last character in the control, the returned coordinates are of the position just past the last character of the control.

QuickInfo

  Windows NT: Requires version 4.0 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in winuser.h.

See Also

Edit Controls Overview, Edit Control Messages, EM_CHARFROMPOS, POINTL