From 05df480e06d1c087666746700345ff9d04ab2b46 Mon Sep 17 00:00:00 2001 From: ondrej Date: Thu, 24 Nov 2016 23:35:50 +0000 Subject: [PATCH] win32: revert r52438 #4361125363 for TListView and fix WParam parameter. Without it, TListView doesn't scroll (other components scroll happily with forwarded WM_HSCROLL and WM_VSCROLL). git-svn-id: trunk@53444 - --- lcl/interfaces/win32/win32winapi.inc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lcl/interfaces/win32/win32winapi.inc b/lcl/interfaces/win32/win32winapi.inc index 9e1b455446..c861cf37e9 100644 --- a/lcl/interfaces/win32/win32winapi.inc +++ b/lcl/interfaces/win32/win32winapi.inc @@ -180,6 +180,13 @@ 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);