Solved

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

Posted on 2009-06-30
6
606 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Nadia
Linear search (searching each index in an array one by one) works almost everywhere but it is not optimal in many cases. Let's assume, we have a book which has 42949672960 pages. We also have a table of contents. Now we want to read the content on p…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

733 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