Article View: borland.public.cppbuilder.nativeapi
Article #13880SpecialFolderLocation!
From: Safari
Date: Sun, 14 Sep 2003 16:11
Date: Sun, 14 Sep 2003 16:11
34 lines
2048 bytes
2048 bytes
Hello Remy,
I want this exmaple in Win9X (not WinNT)
This sample works correctly in WinNT.
// My ComboBox contains
// Desktop, Document, Program Files, Programs, Startup, System, Windows, ...
AnsiString __fastcall GetPaths(int Path)
{
PItemIDList idList;
char idPath[MAX_PATH];
SHGetSpecialFolderLocation(0, Path, &idList);
SHGetPathFromIDList(idList, idPath);
return String(idPath);
}
void __fastcall TMain::ComboBoxChange(TObject *Sender)
{
AnsiString CurPath;
switch(ComboBox->ItemIndex)
{
case 0: CurPath = GetPaths(CSIDL_DESKTOP); break;
case 1: CurPath = GetPaths(CSIDL_PERSONAL); break;
case 2: CurPath = GetPaths(CSIDL_PROGRAM_FILES); break;
case 3: CurPath = GetPaths(CSIDL_PROGRAMS); break;
case 4: CurPath = GetPaths(CSIDL_STARTUP); break;
case 5: CurPath = GetPaths(CSIDL_SYSTEM); break;
case 6: CurPath = GetPaths(CSIDL_WINDOWS); break;
// Continue ...
}
Edit1->Text = CurPath;
}
Thanks,
Safari
Technical Details
Message-ID:
<3F649347.7090500@alloymail.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,64d61a6d0b62f704 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-09-14 14:21:52 PST Message-ID: <3F649347.7090500@alloymail.com> Date: Sun, 14 Sep 2003 20:41:51 +0430 From: Safari <Safari@alloymail.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: SpecialFolderLocation! Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 194.225.63.198 X-Trace: newsgroups.borland.com 1063574382 194.225.63.198 (14 Sep 2003 14:19:42 -0700) Lines: 35 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail