I've writtten a shell extension (guided by The Complete Idiot's Guide to Writing Shell Extensions) which worked as it should until I upgraded to Windows 7(32bit).
Now, the function DragQueryFile
UINT uNumFiles = DragQueryFile(hDrop,0xFFFFFFFF,NULL,0);
returns the right number of selected files until the number is above 16. Then always 16 is returned.
I've tested it in XP(32) and Vista(32), there it works, in Windows7 (32/64) it doesn't.
Any ideas?
Thanks.
The IShellExtInit.Initialize() method is called once again, with full file list, after your command is invoked, just before IContextMenu.InvokeCommand() is called by the shell. Then you have the opportunity to collect the file list again.
You just cannot rely on the file count on the first Initialize() call, so do not show it in your context menu item if it is over 16.
I have seen some posts that talk about the limit of 16 files in explorer, and claim that the problem is solved changing the registry value of MultipleInvokePromptMinimum. This is not necessary, since the full list of files is retrieved in the second call just before the invokeCommand function is called.
I proved this idea by writing in a registry key all files read on the initialize function, after deleting this registry key. This way, the list of files is updated every time initialize is called.