EM_POSFROMCHAR

This message is sent by an application to retrieve the coordinates of the specified character in an edit control.

At a Glance

Header file: Winuser.h
Windows CE Versions: 1.0 and later

Syntax

EM_POSFROMCHAR wCharIndex = (WPARAM) wParam;

Parameters

wCharIndex

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

On return, the x-coordinate of the character is contained in the LOWORD of the LRESULT and the y-coordinate is contained in the HIWORD of the LRESULT.

Any index beyond the last character returns –1.

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.

See Also

EM_CHARFROMPOS