[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

CSIDL_DRIVES?

Posted on 1998-09-18
2
Medium Priority
?
1,138 Views
Last Modified: 2008-03-10
procedure Tdemarrage.programmesClick(Sender: TObject);
var
ppidl:PItemIDList;
Path:array[0..MAX_PATH] of char;
begin
     SHGetSpecialFolderLocation(Handle,CSIDL_DRIVES,ppidl);
     SHGetPathFromIDList(ppidl,Path);
     ShellExecute(Handle,'open',path,'','',SW_show);
end;

 CSIDL_DESKTOP,CSIDL_STARTMENU work but the other CSIDL_... doesn't.
Why?
0
Comment
Question by:seb24
[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
  • 2
2 Comments
 
LVL 20

Accepted Solution

by:
Madshi earned 150 total points
ID: 1340109
seb24,

SHGetPathFromIDList does only return path names like "c:\windows\desktop" or "e:\".
CSIDL_Drives is the "MyComputer" pidl. There's no "normal" path for it.

Regards, Madshi.

P.S: It seems that you've forgotten to free the pidl! Please add the following line add the end of your procedure:

  FreePidl(ppidl);

And the following procedure to your unit:

procedure FreePidl(var pidl: PItemIDList);
var malloc : IMalloc;
begin
  if (pidl<>nil) and (SHGetMalloc(malloc)=NOERROR) then begin
    malloc.Free(pidl);
    pidl:=nil;
  end;
end;

P.P.S: You can use the IShellFolder interface to get the display name of CSIDL_Drives (and other). But that can't be done in a few lines...
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1340110
P.P.P.P.P.P.S: With ShellExecuteEx you can execute the pidl returned from SHGetSpecialFolderLocation directly. Perhaps that works with ShellExecute, too. I don't know. If not, then look at ShellExecuteEx.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

649 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