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 -
This commit is contained in:
ondrej 2016-11-24 23:35:50 +00:00
parent e620f28fae
commit 05df480e06

View File

@ -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);