如何捕捉 EM_SHOWBALLOONTIP CEdit 消息?

问题描述 投票:0回答:2

我正在尝试在

CEdit EM_SHOWBALLOONTIP
函数中捕获
PreTranslateMessage
消息。 有人可以告诉我该怎么做吗? 谢谢你

BOOL CTestDlg::PreTranslateMessage(MSG* pMsg)
{
    if (pMsg->hwnd == m_edit1.GetSafeHwnd())
    {
        if (pMsg->message == EM_HIDEBALLOONTIP)
        {
        }
        
    }
    return CDialogEx::PreTranslateMessage(pMsg);
}
c++ mfc window sendmessage cedit
2个回答
2
投票

PreTranslateMessage
嵌套在消息循环内。因此,仅针对“排队消息”调用它。 EM_SHOWBALLOONTIP
 是已发送的消息,永远不会出现在消息队列中。
换句话说:您无法在

EM_SHOWBALLOONTIP

实现中观察到

PreTranslateMessage
    


0
投票

声明

afx_msg LRESULT OnShowTip(WPARAM wParam, LPARAM lParam);

实施

BEGIN_MESSAGE_MAP(MyEdit, CEdit) ON_MESSAGE(EM_SHOWBALLOONTIP, OnShowTip) END_MESSAGE_MAP() LRESULT MyEdit::OnShowTip(WPARAM wParam, LPARAM lParam) { // Suppress the tooltip by returning TRUE return TRUE; }

© www.soinside.com 2019 - 2024. All rights reserved.