How to create a shell folder?

Just starting out? Need help? Post your questions and find answers here.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

How to create a shell folder?

Post 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?
freak
PureBasic Team
PureBasic Team
Posts: 5944
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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.
quidquid Latine dictum sit altum videtur
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post 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.
freak
PureBasic Team
PureBasic Team
Posts: 5944
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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.
quidquid Latine dictum sit altum videtur
Post Reply