如何捕捉 EM_SHOWBALLOONTIP CEdit 消息?

问题描述

我正在尝试在 CEdit EM_SHOWBALLOONTIP 函数中捕获 PreTranslateMessage 消息。 有人能告诉我怎么做吗? 谢谢

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

解决方法

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

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

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...