Share via


CEdit::CharFromPos

int CharFromPos( CPoint pt ) const;

Return Value

The character index in the low-order WORD, and the line index in the high-order WORD.

Parameters

pt

The coordinates of a point in the client area of this CEdit object.

Remarks

Call this function to retrieve the zero-based line and character indices of the character nearest the specified point in this CEdit control

Note   This member function is available beginning with Windows 95 and Windows NT 4.0.

For more information, see in the Win32 documentation.

Example

#ifdef _DEBUG
   // The pointer to my edit.
   extern CEdit* pmyEdit;
   // The point where the user clicked the mouse.
   extern CPoint myPt;

   int n = pmyEdit->CharFromPos(myPt);
   int nLineIndex = HIWORD(n);
   int nCharIndex = LOWORD(n);
   TRACE(TEXT("nLineIndex = %d, nCharIndex = %d\r\n"), nLineIndex, nCharIndex);
#endif

CEdit OverviewClass MembersHierarchy Chart

See Also   CEdit::PosFromChar