Hello beautifull goys !

the mouse message WM_MOUSEWHEEL is strongly linked with the slider movement.

In order to release the mouse message WM_MOUSEWHEEL from the CSlider control I tryed the following solution (overriding):





1) I make a CSliderCtrl derived class (CMySliderCtrl) and add member variable and function :


private:
bool m_allowMouseActivation;
//
public:
void SetMouseActivation(bool activate);




2) initialized the variable in the constructor


CMySliderCtrl::CMySliderCtrl()
{
m_allowMouseActivation = true;
}




3) in the derived class I overrided the message WM_MOUSEWHEEL :


BOOL CMySliderCtrl::OnMouseWheel(UINT nFlags, short zDelta, CPoint point)
{
// TODO: Add your message handler code here and/or call default

if (m_allowMouseActivation)
CSliderCtrl::OnMouseWheel(nFlags, zDelta, point);
}




4) code for function to change mouse activation



void CMySliderCtrl::SetMouseActivation(bool activate)
{
m_allowMouseActivation = activate;
}





5) then to set the mouse activation, , I added lines like this in CMyProgramDlg:

BOOL CMyProgramDlg::OnMouseWheel(UINT nFlags, short zDelta, CPoint point)
{
// TODO: Add your message handler code here and/or call default

m_slider.SetMouseActivation(false);

CSliderCtrl::OnMouseWheel(nFlags, zDelta, point);
}




QUESTION : why this way to overriding the message doesn't work ?

Please can you help me in find the error ?

Thank very much