I am trying to implement a filesystem browser using the WindowsAPICodePack for C# (.Net 4), and it works pretty well, except that the ShellObject system treats zip files as folders, whereas I’d prefer they be files. Is there some way I can force it to work this way? The low-level interop it does is beyond me.
As far as I can tell, internally it asks if the item is a Folder or a Filesystem element. It then uses this (and some type checks) to figure out what it actually is. Is it safe to force it to treat it as a file if it’s Compressed? Or do I have to do something else?
Ok, well first, I saw that there was a flag in
ShellNativeMethods.SFGAOcalledSFGAO_COMPRESSED. This doesn’t seem to actually appear ever though, maybe it was deprecated?Failing that, I eventually just cheated and did the following in ShellObjectFactory.cs:
Below:
I added:
And then I replaced
with
This is a total hack, but it seems to work, so unless someone has a better idea I’m sticking with this. Hopefully it’ll help someone else out in the future, posts on the WindowsAPICodePack seem pretty rare.