问题描述
我正在尝试在 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
。