Page 1 of 1

How to create a shell folder?

Posted: Tue Mar 25, 2008 5:50 pm
by Mistrel
I'm trying to figure out how to create a shell browser using the IShellFolder interface but I don't understand the process.

Would someone explain how to use this interface?

Posted: Tue Mar 25, 2008 6:21 pm
by freak
Why not try a search ?

You will find these two codes from me which use the interface:
http://www.purebasic.fr/english/viewtop ... 925#170925
http://www.purebasic.fr/english/viewtopic.php?t=20838

Basically you always start with SHGetDesktopFolder_() to get the desktop folder
which is the root of the namespace and then call its methods to get to
the folder you actually want to work with.

Posted: Tue Mar 25, 2008 6:28 pm
by Mistrel
I found your sources but what I don't understand is how to create a shell browser like the one in a file dialog or a file manager.

Posted: Tue Mar 25, 2008 6:41 pm
by freak
In this case you need to call IShellFolder::CreateViewObject to get a view object for the folder, then query the object for IShellView.
You then need to implement your own IShellBrowser interface which is the counterpart to IShellView.
You should then be able to call IShellView::CreateViewWindow with your browser as parameter to create a folder view window.

Thats a lot of hassle to simply display a folder.
The much simpler solution is to use a WebGadget and set the address to the local directory.