Discussion:
CWnd isnt generating mousewheel events
(too old to reply)
Carpii
2005-10-17 16:39:56 UTC
Permalink
Hi,
I have a custom CWnd control, using VC6.0
I added a MouseWheel handler to the control

afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);

and a function body,

BOOL CTab::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
MessageBeep(0);
return 0;
}

When I breakpoint MessageBeep(0), i see that it is not being called
even when I mousewheel over the CWnd control.
Is there anything else I need to do to handle these messages in my
custom control.

Thanks
Carpii
CheckAbdoul
2005-10-17 16:47:33 UTC
Permalink
Make sure you have the following added to the BEGIN_MESSAGE_MAP(...) ,
END_MESSAGE_MAP() block.

ON_WM_MOUSEWHEEL()
--
Cheers
Check Abdoul
-----------------
Post by Carpii
Hi,
I have a custom CWnd control, using VC6.0
I added a MouseWheel handler to the control
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
and a function body,
BOOL CTab::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
MessageBeep(0);
return 0;
}
When I breakpoint MessageBeep(0), i see that it is not being called
even when I mousewheel over the CWnd control.
Is there anything else I need to do to handle these messages in my
custom control.
Thanks
Carpii
Minus
2005-10-18 08:35:53 UTC
Permalink
Make sure the window has the focus, say, by clicking on it.

Be well.
sudantha
2011-12-02 10:21:41 UTC
Permalink
Carpii wrote on 10/17/2005 12:39 ET
Post by Carpii
Hi
I have a custom CWnd control, using VC6.
I added a MouseWheel handler to the contro
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
and a function body
BOOL CTab::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt
MessageBeep(0)
return 0
When I breakpoint MessageBeep(0), i see that it is not being calle
even when I mousewheel over the CWnd control
Is there anything else I need to do to handle these messages in m
custom control
Thank
Carpi
Make sure WS_TABSTOP style is set when creating. Wouldn't work without it
Loading...