WM_MOUSEWHEEL
The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_MOUSEWHEEL
WPARAM wParam, // key indicator and wheel rotation
LPARAM lParam // horizontal and vertical position
);
Parameters
wParam
The low-order word indicates whether various virtual keys are down. This parameter can be one or more of the following values. Value Description
MK_CONTROL The CTRL key is down.
MK_LBUTTON The left mouse button is down.
MK_MBUTTON The middle mouse button is down.
MK_RBUTTON The right mouse button is down.
MK_SHIFT The SHIFT key is down.
MK_XBUTTON1 Windows 2000/XP: The first X button is down.
MK_XBUTTON2 Windows 2000/XP: The second X button is down.
The high-order word indicates the distance the wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user.
注意最后一段的说明。
百度翻译
wm_mousewheel
的wm_mousewheel消息发送到焦点窗口时,鼠标滚轮旋转。这个函数将消息发送到窗口的父。不应该有内部转发的消息,因为它必须传播它的母链,直到找到一个,它的窗口过程。
窗口通过函数接收到这个消息。
LRESULT CALLBACK WindowProc(
HWND hWnd句柄窗口,/ /
单位umsg,/ / wm_mousewheel
wParam参数wParam,/ /关键指标和车轮的转动
lParam指向/水平和垂直位置
);
参数
wParam
低位字指示各种虚拟键下。这个参数可以是下列一个或多个值。值描述
mk_control Ctrl键被按下。
mk_lbutton鼠标左键向下。
mk_mbutton鼠标中键向下。
mk_rbutton鼠标右键关闭。
mk_shift Shift键向下。
mk_xbutton1 Windows 2000 / XP:第一X按钮关闭。
mk_xbutton2 Windows 2000 / XP:第二X按钮关闭。
高位字表示距离车轮旋转,在wheel_delta倍数或部门表示,这是120。正值表示车轮向前旋转,远离用户;负值表示车轮向后旋转,朝向用户。
注意最后一段