Link to home
Start Free TrialLog in
Avatar of Krugar
Krugar

asked on

Explorer folder views

Hi all,

I've been trying to figure this one out for a bit & I'm stumped.  What I need to do is write a VB6 program that will set windows explorer's default view.

For example:  If the user were to select View | Details & then go into Tools | Folder Options | Views & click on "Like Current Folder"  Everything should then be displayed in the Detailed format.

I need to write a program that will do that for the user.

I've managed to find  IShellView::SaveViewState(void) to save the settings for 1 folder, but I can't parse every folder on every drive.  I need to find out what Windows does when "Like Current Folder" is clicked & call it myself.  I suspect this is in Shell32.dll but I haven't found it yet.

The only other useful info I can pass along is the FOLDERVIEWMODE enum contains the folder views.

I'm not looking for complete code, a snippet of what to declair & an example of how to call it will do nicely.  The ultimate goal is to set the folder views to "Details" for anyone running the program.

Thanks in advance & Cheers!
Avatar of shivsa
shivsa
Flag of United States of America image

Avatar of Krugar
Krugar

ASKER

Hi shivsa,

I may not be able to see this for looking, but are not both of those about MS Outlook folders?  AFAIK I can't use an outlook form for Windows Explorer, but I've never developped for Outlook ...

I'm certainly open to suggestion, I was hoping to find out what Windows calls when somebody clicks on "Like Current Folder", however my ultimate goal is to have all the systems defaulting to the "Details" view.  As long as I don't have to manually call each directory (I can already do this.).

Any ideas?

Cheers!

Avatar of Krugar

ASKER

Hi shivsa,

I read through the code you posted and I'm a bit confused by it.  Unless my C++ is off, the I can use IShellView class to change specific know windows and / or create new ones.

I need to change the default for all Explorer windows in W2K Pro, not window by window.   Besides the default StreamsMRU in W2K defines only 200 remebered window settings.  Most, if not all of my users have more than 200 directories.

I did finally find a way to do this by manipulating the following RegValues:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Settings
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults\{F3364BA0-65B9-11CE-A9BA-00AA004AE837}

If you can tell me how the code you posted accomplishes the same, I'd rather use the OS to change the settings over hacking the registry.  (Changes should then be immediate instead of having to restart explorer.exe).

Anyway the reg hack does work, I'll leave the question open a bit to see if I've missed something in the C++ code or if somebody knows how to do the same via a windows call / api.

Cheers!
PAQ/refund.
Avatar of Krugar

ASKER

Actually the reg keys above don't work for every system & don't always work on my test systems.  We ended up dropping this as a requirement & moving on.

I still don't know what windows does when somebody clicks the "Like Current Folder" button.  I'd love to find out, but now it's just a curosity.  This is the one that got away lol.

Thanks shivsa for trying :)

Cheers!
ASKER CERTIFIED SOLUTION
Avatar of Lunchy
Lunchy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial