【问题标题】:How to catch EM_SHOWBALLOONTIP CEdit Message?如何捕捉 EM_SHOWBALLOONTIP CEdit 消息?
【发布时间】:2021-09-14 21:08:48
【问题描述】:

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

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

【问题讨论】:

  • 您是否尝试在没有pMsg->hwnd == m_edit1.GetSafeHwnd() 条件的情况下测试该消息?
  • 我已经试过了。但它没有用。

标签: c++ mfc window sendmessage cedit


【解决方案1】:

PreTranslateMessage 嵌套在消息循环中。因此,只为queued messages 调用它。 EM_SHOWBALLOONTIP 是已发送的消息,永远不会在消息队列中结束。

换句话说:您无法在PreTranslateMessage 实现中观察EM_SHOWBALLOONTIP

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-04
    • 2011-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多