Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This message retrieves the coordinates of the specified character in an edit control.

Syntax

EM_POSFROMCHAR 

wCharIndex = (WPARAM)
 wParam; 

Parameters

wCharIndex

Specifies the zero-based index of the character.

Return Value

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 LOWORDof the LRESULTand the y-coordinate is contained in the HIWORDof the LRESULT.

Any index beyond the last character returns –1.

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

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

If wCharIndexis 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.

Requirements

Header windows.h
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also