Help Center

CEdit.CharFromPosmethod

Gets information about the character closest to a specified point in the client area of an edit control.

WindowsmethodCEdit.incdocumented

Syntax

FUNCTION CharFromPos (BYVAL hEdit AS HWND, BYVAL x AS SHORT, BYVAL y AS SHORT) AS DWORD

Parameters

NameDescription
xThe x-coordinate of a point in the control's client area.
yThe y-coordinate of a point in the control's client area.

Return value

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.

Description

Gets information about the character closest to a specified point in the client area of an edit control.

Remarks

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

Reference

  • Include file CEdit.inc
  • Defined in AfxNova/CEdit.inc:165
  • Documented in Windows/WIndows Controls/CEdit Class.md
  • Topic: CEdit Class