explorerplusplus icon indicating copy to clipboard operation
explorerplusplus copied to clipboard

Delete doesn't delete multiple files in search results window

Open CanuckGamer opened this issue 6 years ago • 3 comments

I do a search. The search window shows multiple search results. I choose more than one, and press the delete key (or right click and delete). This delete only deletes one of the many selected files. For example, if I select 5 files and click delete, only 1 file is deleted. If I search again there are now 4 results.

CanuckGamer avatar Nov 01 '19 00:11 CanuckGamer

@derceg posted good feedback on bad PR #261 "I don't think this will work as it is, unfortunately. While it does work if each item is in the same folder, it doesn't work if the items are in different folders. IShellFolder::GetUIObjectOf (which is part of what's used to display the context menu) returns an object for items that are direct children of the parent. Passing it relative paths to items in different folders won't work as expected.

If you search for items in different folders, then right-click two items that are in the same folder, this solution works. If, however, you right-click two items that are in different folders, then the context menu shown won't work properly. For example, if you try to open the items, you'll find that the path to one of them is incorrect (since the parent directory is expected to be the directory that the first item is contained within). Similarly, the properties dialog won't show the correct size for the files, because the second file doesn't exist in the same directory.

A complete solution might involve something like IResultsFolder as mentioned in https://stackoverflow.com/questions/34553835/how-to-display-system-context-menu-for-multiple-files-in-different-folders. I'm not sure if there are any other ways of doing it, it might need more investigation."

sean-e avatar Oct 12 '20 23:10 sean-e

Would be a good feature, thanks for your work.

jerviscui avatar Oct 21 '22 07:10 jerviscui

It would be great if this could be fixed, I looked a bot around on the subject of multiple files from different parent folders, and found this blog post https://www.zabkat.com/blog/08Jul07.htm describing the required mechanism, it sounds a bit convoluted, but doable.

DavidXanatos avatar Apr 11 '23 17:04 DavidXanatos