如何在类中添加WM_MOUSEMOVE消息? [英] How to add WM_MOUSEMOVE message in a class?
本文介绍了如何在类中添加WM_MOUSEMOVE消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
class CMyListBox : public CWindowImpl<CMyListBox, CListBox>,
public COwnerDraw<CMyListBox>
{
public:
BEGIN_MSG_MAP(CMyListBox)
MSG_WM_MOUSEMOVE(OnMouseMove)
CHAIN_MSG_MAP_ALT(COwnerDraw<CMyListBox>, 1)
DEFAULT_REFLECTION_HANDLER()
REFLECT_NOTIFICATIONS()
END_MSG_MAP()
LRESULT OnTimer( UINT /* Unnamed */, WPARAM wParam, LPARAM /* Unnamed */, BOOL & /* Unnamed */);
};
错误C2065:''MSG_WM_TIMER'':未声明的标识符
我不知道为什么会发生这种情况,有谁知道为什么?谢谢。
error C2065: ''MSG_WM_TIMER'' : undeclared identifier
I don''t exactly know why would this happen, does anyone know why? Thanks you.
推荐答案
我认为你错过了OnTimer()函数的消息映射。
在BEGIN_MSG_MAP部分请添加MSG_WM_TIMER( OnTimer),并尝试它是否正常工作。
I think you have missed the message mapping for OnTimer() function.
In BEGIN_MSG_MAP section please add "MSG_WM_TIMER(OnTimer)", and try if it is working.
这篇关于如何在类中添加WM_MOUSEMOVE消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文