1 Attachment(s)
FolderView: Enhance Folder View "Templates" in Windows 10
Something that bugs me about Windows 10 is how few Folder View Templates there are to choose from:
Attachment 137785
So I'm rolling up my sleeves and trying to figure out how to enhance/replace this functionality. This is a brand new project I'm starting today, written in VB6, and after initial research I already have many questions about Windows. Not so much VB6, but hopefully this is an acceptable thread. I just need a place to organize my notes and whatnot, and I'm most comfortable using MB threads for this kind of thing.
I envision FolderView's user interface as part of the context menu when you right-click the blank space on the right side of a folder in explorer. So far, I'm able to add both basic items as well as submenus, so that's all I should really need.
The actual Folder View settings for any given folder are held in the registry, so in theory it should be a simple matter to copy settings from any given folder to any other given folder or group of folders. (Like, for example: Apply this folder's view settings to all subfolders.)
2 Attachment(s)
Re: FolderView: Enhance Folder View "Templates" in Windows 10
My first question is how to translate these strings. For a test, I used the linked ShellBagsView utility to locate a longish folder name for one of my apps: CharacterBuilderLite. ShellBagsView says it's Slot Number 293. When I use regedit to navigate over to...
HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\293
...and look for string data in the binary field, here's what it looks like:
Attachment 137793
That's not very promising. Not only don't I see the obvious human-readable text all the examples show, but I also see the same two rows repeating four times.
EDIT: The 293 key has no values, only a single subkey "Shell." Shell has one value (SniffedFolderType with value "Documents") and one subkey. That subkey has lots and lots of values, most of which are REG_DWORDs. The only non-numeric values are as follows:
ColInfo (Binary) -- as shown in the image above
GroupByKey:FMTID (String) "{00000000-0000-0000-0000-000000000000}"
Vid (String) "{137E7700-3573-11CF-AE69-08002B2E1262}"
Sort (Binary) -- see image below
And finally, the key itself is named "{7D49D726-3C21-4F05-99AA-FDC2C9474656}"
Attachment 137795
Anyone have any ideas? The data is clearly somewhere based on ShellBagsView working, and it pretty much has to be somewhere inside this 293 key, right? I'm just not seeing it yet.
EDIT 2: Okay, that same Vid value shows up in a ton of other slot numbers. So it's definitely not that.
EDIT 3: The key name shows up in a bunch of other slot numbers as well, so it's most likely not there either.
Re: FolderView: Enhance Folder View "Templates" in Windows 10
Aha, I see the human-readable path names under the BagMRU key, not the Bags key. Not for CharacterBuilderLite; I haven't figured out how to connect the MRU list to the slot numbers when just given a path name to look up quite yet. But progress!
Re: FolderView: Enhance Folder View "Templates" in Windows 10
Apparently my (very old) registry library doesn't read/write binary values properly. (Or at all.) So now I'm trying to figure out how to get that working.
Anyone know how to read/write binary registry values using API? I'm not interested in scripting, or anything that adds a reference or component.
Re: FolderView: Enhance Folder View "Templates" in Windows 10
Found a link on these forums from ten years ago to:
Easy-to-use Registry Editing Class
Testing just now, this properly reads binary data from some test keys I added to the registry. I copied actual ShellBag items to a temporary HKCU key so I could play around with them and make sure my read/write calls are correct before I let them loose on actual ShellBags.
I now appear to be armed with all the tools I need, finally! Now it's just a matter of sitting down and writing this thing.
Re: FolderView: Enhance Folder View "Templates" in Windows 10
Posting to ease your loneliness...
Re: FolderView: Enhance Folder View "Templates" in Windows 10
Ran across another forensics paper that may be of use at some point:
PDF: Windows ShellBag Forensics in Depth
Re: FolderView: Enhance Folder View "Templates" in Windows 10
For this project I'm going to need to know the location of all Windows 10 special folders. That way I can find the appropriate shellbags when, say, you open Documents, then in the left side panel you click "Music" under Documents, then go to the Artist\Allbum subfolder. The shellbag path for that may very well be:
Music\Artist\Album
As opposed to:
C:\Users\Ellis\Music\Artist\Album
Pretty sure I'm going to be receiving the latter from the context menu, but I will need to convert it to the former to compare against shellbag paths.
Code for locating special folders in Windows XP using SHGetFolderPath() is everywhere. But code for finding special folders in Vista and later using SHGetKnownFolderPath() is remarkably difficult to find. Most everything I found used typelibs or late-bound shell scripting objects. Nothing that just used simple API calls.
Thankfully I finally found Randy Birch's sample project showing how to do it, so I adapted his technique into a bas module with a simple interface for programmers. I've added this to the CodeBank in case anyone else wants it:
VB6: Windows 10 Known Folders / SHGetKnownFolderPath