Special folders: Better internal support or FS plugin?
Moderators: Hacker, petermad, Stefan2, white
Special folders: Better internal support or FS plugin?
There are quite a few special folders/places in Windows like recycle bin, control panel, libraries and so on. All these places have quite interesting content fields in Explorer. The recycle bin shows me the original location and in libraries I can see the actual storage location of a file. These things are not available when displayed in TC.
I think there are beasically two solution:
1) Add these fields as if these places would be FS plugins where we have additional fields.
2) Make FS plugins which have these fields.
What do you think - what would be the better solution?
I think there are beasically two solution:
1) Add these fields as if these places would be FS plugins where we have additional fields.
2) Make FS plugins which have these fields.
What do you think - what would be the better solution?
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I tried to support them, but they all rely on a ShellView to display this extra data - it's not possible to get the data via IShellFolder and display it myself in my own listboxes.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I'm using SHGetDataFromIDList(...,SHGDFIL_FINDDATA,... and if it fails, GetDetailsEx. But the latter is terribly slow because it needs several calls per file.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
There is also a third way: Use a regular content plugin (shelldetails) for these folders. This would require a new optional function (e.g. ContentGetValueByID) where TC sends the ID to the plugin function instead of the filename. It would be _very_ easy to add it to shelldetails.
If you are interested in implementing it internally I can post example code here or send it to you.
I think all these solutions would work okay. A FS plugin based solution has the downside that the location would exist more than once - which is a bit confusing.
If you are interested in implementing it internally I can post example code here or send it to you.
I think all these solutions would work okay. A FS plugin based solution has the downside that the location would exist more than once - which is a bit confusing.
These special content fields are not only interesting as Lefteous said, but also very useful, an old TC user told me that he could not throw Windows Explorer away completely for two reasons, one of these reasons is the windows recycle bin has Date Deleted and Original Location.
If Lefteous's new solution can work okay, that would be absolutely awesome.
If Lefteous's new solution can work okay, that would be absolutely awesome.
2MVV
Another reason is that plugins who wants to provide fields for items not having a corresponding regular path wouldn't work.
Well of course you can get a regular path from an item ID if there is such a corresponding regular path. But how does that help? For mentioned solution #3 TC would have to _call_ the content plugin getValue function in these special folders. If it would do this it could do that by using the existing function but I wouldn't recommand it. For performance reasons a new function which passes the ID list to the plugin would be the better choice.I'm talking about shell interfaces (mentioned IShellFolder e.g.).
Another reason is that plugins who wants to provide fields for items not having a corresponding regular path wouldn't work.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
How would you handle virtual folders in plugins? You can't read from file objects in virtual folders. The only thing you can do is send them commands like "copy", "properties" etc.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
2ghisler(Author)
Is this question adressed at me? If yes - I want to display additional information based on an IShellFolder2 object and the PIDL. That's an additional ContentGetValue function having different parameters. It would be called by TC instead of ContentGetValue if the plugin implements it and TC already knows the IShellFolder2 and the corresponding child level PIDL - propably only in virtual folders.How would you handle virtual folders in plugins? You can't read from file objects in virtual folders. The only thing you can do is send them commands like "copy", "properties" etc.
Code: Select all
ContentGetValueByID (IShellFolder2* shellFolder, PCUITEMID_CHILD pidl, int FieldIndex,int UnitIndex, void* FieldValue,int maxlen,int flags)
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Yes, I understand that, but how would you actually get that information from the ID list? Are there actually any functions to get that information? As I wrote, there are no function to read directly from the file data, so it's not possible to get e.g. EXIF data for images in virtual folders.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
GetDetailsEx would only get the data needed for your ShellDetails plugin, it would be useless for almost all other plugins. 

Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com