共用方式為


CRichEditCtrl::CharFromPos

Retrieves information about the character at the point specified by the parameter pt.

int CharFromPos(
   CPoint pt 
) const;

Parameters

  • pt
    A CPoint object containing the coordinates of the specified point.

Return Value

The zero-based character index of the character nearest the specified point. If the specified point is beyond the last character in the control, the return value indicates the last character in the control.

Remarks

This member function works with a rich edit control. To get the information for an edit control, call CEdit::CharFromPos.

For more information, see EM_CHARFROMPOS in the Windows SDK.

Requirements

Header: afxcmn.h

See Also

Concepts

CRichEditCtrl Class

CRichEditCtrl Members

Hierarchy Chart

CRichEditCtrl::PosFromChar