?
Solved

The PIDL Riddle - or: How to get my CSIDL_ back from the PIDL

Posted on 2009-06-30
6
Medium Priority
?
613 Views
Last Modified: 2013-12-14
Hello

I'm using C++ Builder an Win.

Does any one know how to get a CSDIL_ from/over a PIDL?

Reason:
By browsing the (Deskop) Folder and showing the contents in a TreeView, I want to be able to exclude CSIDL_ADMINTOOLS, CSIDL_DRIVES, CSIDL_PRINTERS .... or even not from the TreeView.

If you have a nice CSIDL_, it is easy to get a good PIDL.
But what if you hav a PIDL and want to get the appropriate CSIDL_?

Can any one help me please?

Thanks in advance!
0
Comment
Question by:hasnpapa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 2000 total points
ID: 24760486
For Windows Vista, you can use:
SHGetKnownFolderIDList Function
http://msdn.microsoft.com/en-us/library/bb762187(VS.85).aspx

(what they call a "KNOWNFOLDERID" is just a CSIDL_xxxx value)
For earlier OSes:
I've never tried it, but it seems possible that you could get the filesystem path for the items you need to exclude, then compare the filesystem path of the PIDLs that you have.
    SHGetSpecialFolderLocation
    http://msdn.microsoft.com/en-us/library/bb762203(VS.85).aspx
    SHGetSpecialFolderPath
    http://msdn.microsoft.com/en-us/library/bb762204(VS.85).aspx
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 24760513
It might also be worth while to look at :
    SHGetFileInfo Function
    http://msdn.microsoft.com/en-us/library/bb762179(VS.85).aspx
You can pass it a PIDL and the flag SHGFI_DISPLAYNAME and perhaps work from that.
0
 

Author Comment

by:hasnpapa
ID: 24761835
To identify the folders on theyr path is the idea tht helps!

I'm using i.e.:
SHGetSpecialFolderLocation(NULL, CSIDL_BITBUCKET , &pidl)
and
GetDisplayName(desktops_ShellFolder, pidl, TRUE);
which returns something like
::{21EC2020-3AEA-1069-A2DD-08002B30309D}

Thats the way to identify it later :-)

Thank a lot for bringing me on the right way! :-)


0
 
LVL 49

Expert Comment

by:DanRollins
ID: 24770679
Glad to help.  Thanks for the points and the grade.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Iteration: Iteration is repetition of a process. A student who goes to school repeats the process of going to school everyday until graduation. We go to grocery store at least once or twice a month to buy products. We repeat this process every mont…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question