View Single Post
Old 04-02-2007   #2
Keith Miller MVP
Guest
 
Posts: n/a

Re: Default view of folders reverts back to previous settings.

"cquirke (MVP Windows shell/user)" <cquirkenews@nospam.mvps.org> wrote in
message news:lstv039bmqgjknrntcqdfobg7udi0m4bme@4ax.com...
> On Sat, 31 Mar 2007 10:20:07 -0500, "Keith Miller MVP"
>>"cquirke (MVP Windows shell/user)"

>
>>> I want List view everywhere, with a minimum of content groping

>
>>Set the list view for a folder that's using the 'All Items' template, then
>>use 'Apply to Folders'. Then override content-sniffing with my
>>'AllFolders'

>
>>--------------------------------------------------
>>Windows Registry Editor Version 5.00
>>
>>[HKEY_CURRENT_USER\Software\Classes\Local
>>Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell]
>>"FolderType"="NotSpecified"
>>
>>--------------------------------------------------

>
>>Merging the .reg file will set the 'All Items' template for any folders
>>that
>>don't currently have a view saved with a different template. You can
>>clear
>>all saved views by deleting the

>
>>"HKCU\Software\Classes\Local
>>Settings\Software\Microsoft\Windows\Shell\Bags"

>
>>key BEFORE merging the .reg file. If any folders open with a different
>>template after clearing the 'Bags' key & merging the .reg file, they most
>>likely have a template specified via their desktop.ini file.

>
> Ahh... thanks! I'm a bit confused on the details of how behaviors are
> linked to locations; is it all from file system to behaviors via
> Desktop.ini, or all forward from CLSIDs to locations, or a combination
> of the two? Because it seems to come unstuck easily...
>

View behaviors, right?

First & foremost, saved views are dependent on the namespace path, which is
graphically represented in the folder tree in Explorer.

'Desktop\UserName'

can save a view distinct from

'Desktop\Computer\C:\Users\UserName'

If you take a look at:

'HKCU\Software\Classes\Local
Settings\Software\Microsoft\Windows\Shell\BagMRU'

which is the index to saved views, you'll see that is a tree structure, with
BagMRU corresponding to the Desktop and each numbered subkey representing a
subfolder. If a key has a 'Nodeslot' value, that is the Bag number for the
saved view for that folder.

According to http://msdn2.microsoft.com/en-us/library/ms647825.aspx

"By default, if SHGVSPB_INHERIT is not specified and a property bag cannot
be found for the specified folder, the system searches for identically named
property bags in other locations that may be able to provide default values.
For example, the system searches in the ancestors of the folder to see if
any of them provide a SHGVSPB_INHERIT property bag. Other places the system
searches are in the user defaults and the global defaults.

So, when a folder is opened, Explorer first looks for a saved view for that
particular folder. If that does not exist, Explorer works its way back up
the namespace path to see if any of the parents' views have an 'Inherit'
subkey (this is how 'Also apply this template to all subfolders' works). If
there are none, then Explorer checks for 'AllFolders'. If 'AllFolders'
exists and specifies a template, that template is assigned. If no template
is specified or 'AllFolders' doesn't exist, then content sniffing kicks in.
Once Explorer has determined content type, it will look for the template
UUID under 'AllFolders' and then under:
'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults'
If those don't exist, then the settings found under:
'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\FolderTypes'
will be used.


--
Good Luck,

Keith
Microsoft MVP [Windows XP Shell/User]


  Reply With Quote