Export (0) Print
Expand All

EM_CHARFROMPOS message

Gets information about the character closest to a specified point in the client area of an edit control. You can send this message to either an edit control or a rich edit control.

Parameters

wParam

This parameter is not used.

lParam

The coordinates of a point in the control's client area. The coordinates are in screen units and are relative to the upper-left corner of the control's client area.

Rich edit controls: A pointer to a POINTL structure that contains the horizontal and vertical coordinates.

Edit controls: The LOWORD contains the horizontal coordinate. The HIWORD contains the vertical coordinate.

Return value

Rich edit controls: The return value specifies the zero-based character index of the character nearest the specified point. The return value indicates the last character in the edit control if the specified point is beyond the last character in the control.

Edit controls: The LOWORD 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 HIWORD 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.

Remarks

Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.

If a point is passed to EM_CHARFROMPOS as the lParam and the point is outside the bounds of the edit control, then the lResult is (65535, 65535).

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

See also

Reference
EM_POSFROMCHAR
Other Resources
MAKELPARAM
POINTL

 

 

Community Additions

ADD
Show:
© 2014 Microsoft