CWnd::OnMouseWheel
The framework calls this member function as a user rotates the mouse wheel and encounters the wheel's next notch.
afx_msg BOOL OnMouseWheel( UINT nFlags, short zDelta, CPoint pt );
Unless overridden, OnMouseWheel calls the default of WM_MOUSEWHEEL. Windows automatically routes the message to the control or child window that has the focus. The Win32 function DefWindowProc propagates the message up the parent chain to the window that processes it.
The zDelta parameter is a multiple of WHEEL_DELTA, which is set at 120. This value is the threshold for an action to be taken, and one such action (for example, scrolling forward one notch) should occur for each delta.
WHEEL_DELTA was set to 120 to allow for finer-resolution wheels, such as a freely-rotating wheel with no notches. A finer-resolution wheel sends more messages per rotation, but each message has a smaller delta value. To use such a wheel, either add the incoming zDelta values until WHEEL_DELTA is reached (so that you get the same response for a given delta-rotation), or scroll partial lines in response to the more frequent messages. You can also choose a scroll granularity and accumulate deltas until WHEEL_DELTA is reached.
Override this member function to provide your own mouse-wheel scrolling behavior.
Note
|
|---|
|
OnMouseWheel handles messages for Windows NT 4.0 and later versions. For Windows 95/98 or Windows NT 3.51 message handling, use OnRegisteredMouseWheel. |
Note