From 178c43a3f6aed32ba5cf4a873f3b9af5b83701d5 Mon Sep 17 00:00:00 2001 From: bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Mon, 25 Apr 2016 10:08:00 +0000 Subject: [PATCH] Win32: fix scrolling issue in ListBox with huge amount of items. Patch by Michl. Issue #0023914. git-svn-id: trunk@52246 - --- lcl/interfaces/win32/win32callback.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc index e51896774d..d532d713d0 100644 --- a/lcl/interfaces/win32/win32callback.inc +++ b/lcl/interfaces/win32/win32callback.inc @@ -815,6 +815,14 @@ begin if LMScroll.Pos < High(LMScroll.SmallPos) then LMScroll.SmallPos := LMScroll.Pos else LMScroll.SmallPos := High(LMScroll.SmallPos); + + if Assigned(lWinControl) and (lWinControl is TCustomListbox) and (LMsg = LM_VSCROLL) then + begin + // WM_VSCROLL message carries only 16 bits of scroll box position data. + // This workaround is needed, to scroll higher than a position value of 65536. + WinProcess := False; + TCustomListBox(lWinControl).TopIndex := LMScroll.Pos; + end; end; // FlashWindowEx is not (yet) in FPC