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.
WM_MOUSEWHEEL fwKeys = LOWORD(wParam); // key flags zDelta = (short) HIWORD(wParam); // wheel rotation xPos = (short) LOWORD(lParam); // horizontal position of pointer yPos = (short) HIWORD(lParam); // vertical position of pointer
Value |
Description |
MK_CONTROL |
Set if the CTRL key is down. |
MK_LBUTTON |
Set if the left mouse button is down. |
MK_MBUTTON |
Set if the middle mouse button is down. |
MK_RBUTTON |
Set if the right mouse button is down. |
MK_SHIFT |
Set if the SHIFT key is down. |
The zDelta parameter will be a multiple of WHEEL_DELTA, which is set at 120. This is the threshold for action to be taken, and one such action (for example, scrolling one increment) should occur for each delta.
The delta was set to 120 to allow Microsoft or other vendors to build finer-resolution wheels in the future, including perhaps a freely-rotating wheel with no notches. The expectation is that such a device would send more messages per rotation, but with a smaller value in each message. To support this possibility, you should either add the incoming delta values until WHEEL_DELTA is reached (so for a given delta-rotation you get the same response), or scroll partial lines in response to the more frequent messages. You could also choose your scroll granularity and accumulate deltas until it is reached.
GetSystemMetrics, mouse_event, SystemParametersInfo
file: /Techref/os/win/api/win32/mess/src/msg25_28.htm, 4KB, , updated: 2000/4/7 11:20, local time: 2024/12/29 04:43,
52.14.223.136:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/Techref/os/win/api/win32/mess/src/msg25_28.htm"> WM_MOUSEWHEEL</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.