In this question How to detect mouse wheel tilt an answer is posted and accepted that shows the code needed.
I\'ve implemented that code in my application\'s existing
Use Spy++ to check what messages you are receiving.
EDIT: You can also call m.ToString() in you WndProc method to get the name (!) of the message you've received. (This is done by a giant switch statement in Syetm.Windows.Forms.MessageDecoder.MsgToString
)
Note that the messages might be sent only to whatever control has focus and not to the form itself; if that is the case, you might want to use a message filter.
Also, note that different mice send different mousewheel messages. I have a Logitech mouse that sends 0x20E
with a WParam
that is negative for left scroll and positive for right scroll.
EDIT (in reponse to comments)
Remember that horizontal scrolling was added long after vertical scrolling and is not supported by older programs. Therefore, the mouse driver could well be looking for horizontal scrollbars and scrolling them explicitly. Try adding a horizontal scrollbar to your form, positioned negatively so the user won't see it, and see if that changes anything.