如何实现下面的消息响应?
CStatic派生的类CStaticDemo能够响应我OnMouseMove ,怎么响应onmouseleave?
其中CStaticDemo.h中
protected:
//{{AFX_MSG(CStaticDemo)
afx_msg void OnPaint();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
//}}AFX_MSG
private:
LRESULT OnMouseLeave(WPARAM wParam, LPARAM lParam);
其中CStaticDemo.cpp中
BEGIN_MESSAGE_MAP(CStaticDemo, CStatic)
//{{AFX_MSG_MAP(CUnderLine)
ON_WM_PAINT()
ON_WM_MOUSEMOVE()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_MOUSELEAVE, OnMouseLeave)
END_MESSAGE_MAP()
LRESULT CStaticDemo::OnMouseLeave(WPARAM wParam, LPARAM lParam)
{
CancelHover();
return 0;
} // End of OnMouseLeave
我在dailog中添加一个static控件,
DDX_Control(pDX,IDC_STATIC,m_test1);
结果,当我鼠标移出IDC_STATIC时,跟不到CStaticDemo::OnMouseLeave(WPARAM wParam, LPARAM lParam) 中!为什么?