c++mfcwindowsendmessagecedit

How to catch EM_SHOWBALLOONTIP CEdit Message?


I'm trying to catch CEdit EM_SHOWBALLOONTIP message within PreTranslateMessage function. Can somebody tell me how to do this ? thank you

BOOL CTestDlg::PreTranslateMessage(MSG* pMsg)
{
    if (pMsg->hwnd == m_edit1.GetSafeHwnd())
    {
        if (pMsg->message == EM_HIDEBALLOONTIP)
        {
        }
        
    }
    return CDialogEx::PreTranslateMessage(pMsg);
}

Solution

  • PreTranslateMessage is nested inside the message loop. Consequently, it is called for queued messages only. EM_SHOWBALLOONTIP is a sent message, and never winds up in the message queue.

    In other words: You cannot observe EM_SHOWBALLOONTIP in a PreTranslateMessage implementation.