I want to build a filepath (C:/programms/games/...) from a filled treeview. How can I do that?

Best regards,
Posted on 2005-02-19 08:13:18 by Nordwind64
Hi Nordwind64,

You can use Ketil's method of doing it, it is about the best I have seen. He stores the path information in the treeview labels then builds the path using them. To do this you name the root item after the drive then each item in the treeview is the path section. For example...

RootItem = "C:"
Level one = "Program Files"
Level two = "My Proggie"

So to build a path from "My Proggie" you have only to recursively find it's parent and add a backslash (or foreslash).

I believe that Ketil published an example called TreeViewDir somewhere, if you can't find it I used his method in WinExplorer and can send you a copy.
Posted on 2005-02-19 18:38:42 by donkey
Hi donkey!

if you can't find it I used his method in WinExplorer and can send you a copy.

Yes, please. My mailadress is nordwind256@gmx.de
You're the best!

Thanks, Nordwind64
Posted on 2005-02-20 04:09:01 by Nordwind64
It is available here, I have emailed it to you as well...

Posted on 2005-02-20 08:47:23 by donkey
Hi, donkey.

No mail comes to me, sorry. But I downloaded the zipfile and try to examine your code. Thank you!
My treeview based on Ewaynes code. Look here:

Somewhat complicated - I think I have to detect "Boot (C:)" for "C:/" e.g. However, thanks!

Best regards,
Posted on 2005-02-20 13:00:59 by Nordwind64
I have not seen EWayne's code so I can't really comment on how it works. Generally though, his code is very clear and easy to understand so it should be fairly easy for you to figure out.
Posted on 2005-02-20 13:48:48 by donkey

the solution is very easy! Use an API: SHGetPathFromIDList...

Posted on 2005-02-25 07:58:12 by Nordwind64