Special folders: Better internal support or FS plugin?

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Special folders: Better internal support or FS plugin?

Post by *Lefteous »

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?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
I haven't tried it for all those folders but for the recycle bin it works great using IShellFolder (or IShellFolder2).

How do you display the contents of the size column in the \\Computer folder?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

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.
User avatar
xmeron
Junior Member
Junior Member
Posts: 90
Joined: 2009-06-17, 19:43 UTC

Post by *xmeron »

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.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Is there a way to get file path from these interfaces? It would allow using regular plugins in such cases...
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2MVV
Is there a way to get file path from these interfaces? It would allow using regular plugins in such cases...
What interfaces are you referring to?
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I'm talking about shell interfaces (mentioned IShellFolder e.g.).
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2MVV
I'm talking about shell interfaces (mentioned IShellFolder e.g.).
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.
Another reason is that plugins who wants to provide fields for items not having a corresponding regular path wouldn't work.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
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.
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.

Code: Select all

ContentGetValueByID (IShellFolder2* shellFolder, PCUITEMID_CHILD pidl, int FieldIndex,int UnitIndex, void* FieldValue,int maxlen,int flags)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
GetDetailsEx from IShellFolder2. That's what I use since 2004 in ShellDetails.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
Post Reply