Windows function to return disk label names, and/or desktop level directory info?

I’m messing around with a homegrown Windoze application. I need to provide in separate places a list of available disks, and a directory tree.

I’ve found a utility that will return the raw disk names such as A:\ or C:, but I’d like to also have the volume names available. I tried GetVolumeInformation() to do this, but it’s not working for me. Plus, what I’m doing now won’t pick up stuff at the desktop level, such as My Documents.

Even if I could get this to work, it’s going to be a real PITA to populate a directory tree in a TreeView window. Any pointers to an easier way?

What are you using to write the app?

I know you said you tried GetVolumnInformation, but maybe this code will help you find your problem:

To find the folder that Desktop maps to:

If you’re using .NET, this might be helpful: