Reputation: 23
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);
}
Upvotes: 2
Views: 159
Reputation: 11
You can subclass CEdit as MyEdit to suppress tooltips.
Declare
afx_msg LRESULT OnShowTip(WPARAM wParam, LPARAM lParam);
Implement
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;
}
Upvotes: 0
Reputation: 51395
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.
Upvotes: 2