Parameter | Description |
---|---|
wParam | Window wParam passed by WM_MOUSEWHEEL |
lParam | Window lParam passed by WM_MOUSEWHEEL |
Procedure OnWMMouseWheel Integer wParam Integer lParam
OnWMMouseWheel exposes the windows WM_MOUSEWHEEL event.
The parameters sent to the event wParam and lParam are the standard windows parameters for this event.
wParam
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.
The low-order word indicates whether various virtual keys are down. This parameter can be one or more of the following values.
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. |
// low level event sent from windows. Procedure OnWmMouseWheel Integer wParam Integer lParam Integer iWheelDelta iKeys iDelta iClicks Move (low(abs(wParam))) to iKeys // any keys down when pressed Move (hi(abs(wParam))) to iDelta // number of click units If (wParam<0) Begin Move (-iDelta) to iDelta // can be up or down End Get piWheelDelta to iWheelDelta // Current accumulated micro clicks Move (iWheelDelta+iDelta) to iWheelDelta // C_WHEELDATA is 120 as defined by MS as the delta to react to. Once click is usually 120 Move (iWheelDelta/C_WHEELDELTA) to iClicks // Number of clicks to react to Set piWheelDelta to (mod(iWheelDelta,C_WHEELDELTA)) // remainder unused microclicks // If we have enough Clicks send OnMouseWheel If (iClicks<>0) Begin Send OnMouseWheel iClicks iKeys End // tell windows that we've handled the event. Set Windows_Override_State to True End_Procedure
With the exceptions of the notifications for scrollbars and the mouse wheel evetns, all of the windows scrollbar interfaces can be accessed by creating external_functions. The events SetVScrollBox, SetHScrollBox and OnWMMouseWheel are provided to give you low level access to these events.