Export (0) Print
Expand All
Expand Minimize


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

int CharFromPos(
   CPoint pt 
) const;


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.


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 Platform SDK.

See Also

CRichEditCtrl Overview | Class Members | Hierarchy Chart | CRichEditCtrl::PosFromChar

© 2014 Microsoft