diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc index 36487e0715..82893f5d39 100644 --- a/lcl/interfaces/win32/win32callback.inc +++ b/lcl/interfaces/win32/win32callback.inc @@ -2488,6 +2488,17 @@ begin if PLMsg^.Result = 0 then WinProcess := True; + LM_MOUSEWHEEL: + begin + if (PLMsg^.Result = 0) + and ( + (lWinControl is TCustomListView) + or (lWinControl is TCustomComboBox) + or (lWinControl is TCustomFloatSpinEdit)) + then + WinProcess := True; + end; + WM_SYSCOMMAND: WinProcess := WmSysCommandProcess; @@ -2592,6 +2603,10 @@ begin end; end; + if (PLMsg^.msg = LM_MOUSEWHEEL) // send unhandled scroll messages to parent + and (PLMsg^.Result = 0) and (lWinControl<>nil) and (lWinControl.Parent <> nil) then + lWinControl.Parent.WindowProc(PLMsg^); + // ignore WM_(SYS)CHAR message if LCL handled WM_(SYS)KEYDOWN if ((Msg = WM_KEYDOWN) or (Msg = WM_SYSKEYDOWN)) then if (PLMsg^.Result = 0) then diff --git a/lcl/interfaces/win32/win32int.pp b/lcl/interfaces/win32/win32int.pp index cf2c01cf1f..9df834e309 100644 --- a/lcl/interfaces/win32/win32int.pp +++ b/lcl/interfaces/win32/win32int.pp @@ -33,7 +33,7 @@ uses // LCL LCLPlatformDef, InterfaceBase, LCLIntf, LclProc, LCLType, LMessages, Controls, Buttons, Forms, Dialogs, GraphMath, GraphType, StdCtrls, - Graphics, Menus, ComCtrls, Themes, Win32Def, + Graphics, Menus, ComCtrls, Themes, Win32Def, Spin, // LazUtils LazUTF8, Translations; {, Win32Debug} diff --git a/lcl/interfaces/win32/win32winapi.inc b/lcl/interfaces/win32/win32winapi.inc index 795a3f654c..ab8a137767 100644 --- a/lcl/interfaces/win32/win32winapi.inc +++ b/lcl/interfaces/win32/win32winapi.inc @@ -180,13 +180,6 @@ var ClientToScreen(Handle, Pos); SystemWParam := Windows.WParam(Longint(PointToSmallPointNoChecks(Pos))); - if Sender is TListView then - begin // we need this workaround to make TListView scroll -> forward WM_MOUSEWHEEL directly to it - MMessage^.Result := CallDefaultWindowProc(Handle, MMessage^.Msg, TLMessage(Message).WParam, TLMessage(Message).LParam); - // Windows handled it, so exit here. - if MMessage^.Result<>0 then exit; - end; - // send scroll message FillChar(ScrollInfo, sizeof(ScrollInfo), #0); ScrollInfo.cbSize := sizeof(ScrollInfo); @@ -234,8 +227,6 @@ var MMessage^.Result := Windows.SendMessage(Handle, ScrollMsg, SystemWParam, HWND(nil)); end; - if (MMessage^.Result = 0) and (TControl(Sender).Parent <> nil) then - TControl(Sender).Parent.WindowProc(TLMessage(Message)); end; begin