Antieve wrote: ↑13 May 2022 07:11
I took the time to watch the beta for more details and here are some
quick notes.
Something goes wrong with realization because:
- XYCtx window spamed with
WM_TIMER messages all the time
- XYCtx have a memory leak
- XY(Ctx?) shows non relevant menu sometimes on multiselect (this is an old bug)
- Very slow menu when selecting a lot of files
●CRITICAL #1 and
#2 not fixed (But let's leave these boring things for later, I think the reasons and the solutions are obvious)
Let's talk more about multiselection
For a clear demonstration, save the code as
test.cmd (or whatever you like) and run it from anywhere. It will create a TEST folder next to itself with lots of files inside and will open it in an windows explorer.
Code: Select all
::&cls&::
@echo off
cd /d "%~dp0"
set TestDir=%~dp0TEST
md "%TestDir%"
echo "Just a moment..."
for /L %%N in (1,1,40000) do REM. >"%TestDir%\%%N.txt"
explorer "%TestDir%"
Now CTRL+A to select all files and RMB to show context menu. Now we have an idea of how it should work.
Time to open this folder in XY then CTRL+A, RMB... You can go and make yourself a cup of coffee
Don't feel bad about it, because most of the existing file managers get hung up in a similar situation, but we can easily beat them and make XYPlorer (along with windows explorer) work fast!
One of the reasons is that you don't follow
guidelines
Yes, windows explorer works fast because of passing just first 16 selecting items to a verb. Tricks are everywhere
As far as data transmission is concerned, we can of course use
DDE\DDEML (The current implementation is a simplified version of this approach) But (as usual) I can suggest using
another trick.
At the moment the weak point is the list of files that we have to generate, send, then read and convert. But (as I said before) this is an extremely inefficient approach.
Why not make the system do everything for us and do it faster than we do?
We can programmatically emulate
drag & drop operations on selected files from our window to XYCtx window in
CFSTR_SHELLIDLIST format.
In doing so, the OS will create a PIDLs data package for us and all the associated handy WinAPIs will be available in both processes to manipulate it as we want with minimal writing of our own code.
So if we follow the guidelines, the menu will be even faster and won't get hung up on a huge number of files.
Boom! XY#1 FM now also in this
PS
And thanks again for the bitness, I really missed this kind of convenient implementation of this functionality 