RichJackson
asked on
From Mouse Position To Text Beneath - CRichEditCtrl
I need to be able to grab the mouse move events while the user is moving over a CRichEditCtrl, and determine the character position of the mouse. In other words, the OnMouseMove() method tells me a CPoint, where the mouse pointer is, and I need to convert this over to a
character position within the control.
Anyone any ideas
Cheer
Rich
character position within the control.
Anyone any ideas
Cheer
Rich
ASKER
Cheers, but I gotta a problem with EM_CHARFROMPOS, it just give me zero.
Code below, thanks
CResultsDlg::PreTranslateM essage(MSG * pMsg)
{
if (NULL != m_pToolTip)
m_pToolTip->RelayEvent(pMs g);
if (pMsg->message==WM_MOUSEMO VE &&
pMsg->hwnd==m_note.m_hWnd )
{
long res;
res = m_note.SendMessage(EM_CHAR FROMPOS,0, (long)
&pMsg->pt);
//RES ALWAYS ZERO!
Code below, thanks
CResultsDlg::PreTranslateM
{
if (NULL != m_pToolTip)
m_pToolTip->RelayEvent(pMs
if (pMsg->message==WM_MOUSEMO
pMsg->hwnd==m_note.m_hWnd )
{
long res;
res = m_note.SendMessage(EM_CHAR
&pMsg->pt);
//RES ALWAYS ZERO!
Hi!
IMHO you must convert pt to the RichEdit client coords.
IMHO you must convert pt to the RichEdit client coords.
ASKER
I guess that would explain it, whats the best way of doing the conversion.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cheers, much appreciated
there is message for this:
EM_CHARFROMPOS