Share via


EM_CHARFROMPOS

This message is sent by an application to retrieve the zero-based character index and zero-based line index of the character nearest the specified point in an edit control.

EM_CHARFROMPOS wParam = 0; lParam = MAKELPARAM(x, y);

Parameters

  • lParam
    Specifies the coordinates of a point in the controls client area. The coordinates are in screen units and are relative to the upper-left corner of the controls client area.
    Control Description
    Rich edit controls lParam is a pointer to a POINTL structure that contains the horizontal and vertical coordinates.
    Edit controls The low-order word of lParam contains the horizontal coordinate. The high-order word contains the vertical coordinate.

Return Values

The low-order word of the return value specifies the zero-based index of the character nearest the specified point. This index is relative to the beginning of the control, not the beginning of the line. If the specified point is beyond the last character in the edit control, the return value indicates the last character in the control.

The high-order word of the return value specifies the zero-based index of the line that contains the character. For single-line edit controls, this value is zero. The index indicates the line delimiter if the specified point is beyond the last visible character in a line.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winuser.h    

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

EM_POSFROMCHAR

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.