🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13795

SpecialFolderLocation!

#13795
From: Safari
Date: Sat, 13 Sep 2003 23:12
33 lines
1780 bytes
Hello to all,
Not work in Win9X! why?
Return me an empty value!
// In Win2K/XP works good.

Function GetPath(Path: Integer): String;
Var idList: PItemIdList; idPath: Array[0..Max_Path] of Char;
Begin
    ShGetSpecialFolderLocation(0, Paths, idList);
    ShGetPathFromIDList(idList, idPath);
    Result := idPath;
End;

// and too.
#define NO_WIN32_LEAN_AND_MEAN;
AnsiString __fastcall GetPath(int Path)
{
    PItemIDList idList;
    char idPath[MAX_PATH];
    SHGetSpecialFolderLocation(0, Path, &idList);
    SHGetPathFromIDList(idList, idPath);
    return String(idPath);
}

Procedure TMain.BitBtn1Click(Sender: TObject);
Begin
    Label1.Caption  := GetPath(CSIDL_PROGRAMFILES);
    Label1->Caption  = GetPath(CSIDL_PROGRAMFILES);
    // or Label1.Caption := GetPath($24);
End;

Thanks,
Safari
Technical Details
Message-ID: <3F63A478.1080901@alloymail.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!sienna.impulse.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,64d61a6d0b62f704,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-13 15:16:44 PST
Message-ID: <3F63A478.1080901@alloymail.com>
Date: Sun, 14 Sep 2003 03:42:56 +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.254
X-Trace: newsgroups.borland.com 1063491300 194.225.63.254 (13 Sep 2003 15:15:00 -0700)
Lines: 34
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!sienna.impulse.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail