Directory listings with more than 65k files are messed up
Moderators: white, Hacker, petermad, Stefan2
Directory listings with more than 65k files are messed up
When I enter a directory with more than approx. 65k files, than the following happens: if I scroll down using the scrollbar on the side, files 1-65k are listed properly. If I scroll further down than it begins to list from 1 again. So all files between 65k and the end are not listed.
This seems to be the same in 7.56a.
Please provide a fix for this, as it forces me to go back to Explorer for the first time in 15 years!
Thank you!
This seems to be the same in 7.56a.
Please provide a fix for this, as it forces me to go back to Explorer for the first time in 15 years!
Thank you!
I can confirm this in a limited way. I created 70k files using the following script: and I can scroll to every file in this directory using the scroll bars just fine on WinXP. However, on Win7 the bug exists as described by dvdmaster no matter which TC version is used (tried 7.56a and 8.0 Beta 15 x86 and x64). So this could be a limitation of Win7 GUI elements used by TC.
Regards
Dalai
Code: Select all
@echo off
if "%~1"=="" (
echo Please specify directory to create files in!
goto :EOF
)
pushd "%~1"
for /L %%i IN (1,1,70000) DO (
if %%i LSS 10 call :DO 0000%%i
if %%i LSS 100 if %%i GEQ 10 call :DO 000%%i
if %%i LSS 1000 if %%i GEQ 100 call :DO 00%%i
if %%i LSS 10000 if %%i GEQ 1000 call :DO 0%%i
if %%i LSS 100000 if %%i GEQ 10000 call :DO %%i
)
popd
goto :EOF
:DO
echo Creating %1
copy NUL %1 >NUL
goto :EOF
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
I was using Win7 64-bit. Forgot to mention it in the original post...Dalai wrote:I can confirm this in a limited way. I created 70k files using the following script:
and I can scroll to every file in this directory using the scroll bars just fine on WinXP. However, on Win7 the bug exists as described by dvdmaster no matter which TC version is used (tried 7.56a and 8.0 Beta 15 x86 and x64). So this could be a limitation of Win7 GUI elements used by TC.
Confirm for both 32- and 64-bit versions, but only in Full View (or any multi-column one), and only when scrolling by dragging the scrollbar. If I scroll using the mouse wheel or the keyboard, files are listed correctly.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 10.52 / Win10 x64
Using TC 10.52 / Win10 x64
- ghisler(Author)
- Site Admin
- Posts: 48093
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
This is a known bug of the Windows listbox control.
The problem is that the "position" field of the WM_VSCROLL message is only 16 bit short. The scroll position isn't handled by Delphi, but by Windows itself, so it's clearly a Windows bug which is still in Windows 7.
Subclassing the listbox and handling the message directly seems to fix the problem. Here is the code I'm going to use in the next beta:
As you can see, the position sent via WM_VSCROLL is ignored - instead, GetScrollInfo is used, as described here:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb787577%28v=vs.85%29.aspx
The problem is that the "position" field of the WM_VSCROLL message is only 16 bit short. The scroll position isn't handled by Delphi, but by Windows itself, so it's clearly a Windows bug which is still in Windows 7.
Subclassing the listbox and handling the message directly seems to fix the problem. Here is the code I'm going to use in the next beta:
Code: Select all
if (message.msg=wm_vscroll) and (items.count>32766) and
((message.wparamlo=sb_thumbposition) or
(message.wparamlo=sb_thumbtrack)) then begin
scrollinfo.cbsize:=sizeof(tscrollinfo);
scrollinfo.fmask:=SIF_TRACKPOS or SIF_POS;
GetScrollInfo(handle,SB_VERT,scrollinfo);
if message.wparamlo=sb_thumbtrack then
newposition:=scrollinfo.nTrackPos
else
newposition:=scrollinfo.nPos;
oldposition:=SendMessage(handle,lb_gettopindex,0,0);
if newposition<>oldposition then
SendMessage(handle,lb_settopindex,newposition,0);
exit;
end;
http://msdn.microsoft.com/en-us/library/windows/desktop/bb787577%28v=vs.85%29.aspx
I wonder why Microsoft didn't implement their own suggestion in the listbox control...Note that the WM_VSCROLL message carries only 16 bits of scroll box position data. Thus, applications that rely solely on WM_VSCROLL (and WM_HSCROLL) for scroll position data have a practical maximum position value of 65,535.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
But why does it work on WinXP and even Win2k (checked just now) but not on Win7? MS (re)introduced a bug?ghisler(Author) wrote:[...] so it's clearly a Windows bug which is still in Windows 7.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
- ghisler(Author)
- Site Admin
- Posts: 48093
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
It may be related to themes/AeroGlass. I noticed that the AeroGlass controls don't behave the same as the "normal" controls.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I don't use Aero Glass (no 3D acceleration in VMware 5.5 available) und even tested it with Windows Classic Theme on Win7 (and Luna Theme on WinXP): nothing changes, the problem persists on Win7, but I can't reproduce it on XP. So it's kind of weird...
Regards
Dalai
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Confirm fixed in 8.0β16.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 10.52 / Win10 x64
Using TC 10.52 / Win10 x64
I can confirm the fix, too.
Regards
Dalai
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
- ghisler(Author)
- Site Admin
- Posts: 48093
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact: