Root cause is that MakeWParam expects two unsigned integers, but P.X and P.Y can become negative. You can easily reproduce this bug on a dual monitor setup, where the secondary screen is left of the primary screen.
procedure TSysScrollingStyleHook.DoSliderTrackTimer(Sender: TObject);
var
P: TPoint;
begin
GetCursorPos(P);
if (FPrevPoint <> P) and (FDownPoint <> P) then
begin
SendMessage(Handle, CM_SCROLLTRACKING, MakeWParam(P.X, P.Y), 0);
FPrevPoint := P;
FDownPoint := Point(-1, -1);
end;
end;
This error occurs in the line
SendMessage(Handle, CM_SCROLLTRACKING, MakeWParam(P.X, P.Y), 0);
Root cause is that MakeWParam expects two unsigned integers, but P.X and P.Y can become negative. You can easily reproduce this bug on a dual monitor setup, where the secondary screen is left of the primary screen.