🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: SHGetSpecialFolderLocation!

#14228
From: Rodolfo Frino
Date: Thu, 21 Aug 2003 15:28
32 lines
1898 bytes
Hopefully this should be the final code

String GetSpecialFolderPath(HWND Handle, int FolderNumber)
{
    LPITEMIDLIST  pID_List; // Pointer to the Item Identifire List
    String R = "";

    if (SHGetSpecialFolderLocation(Handle, FolderNumber, &pID_List) ==
NOERROR)
    {
        char SpecialFolderPath[MAX_PATH + 1] = {0};

        if (SHGetPathFromIDList(pID_List, SpecialFolderPath))
            R = SpecialFolderPath;

        CoTaskMemFree(pID_List);
    }

    // Error: is indicated by an empty string
    // The return value is an ampty string if either
    // SHGetSpecialFolderLocation function or SpecialFolderPath
    // function fail.
    return R;
}

Rodolfo


"Safari" <Safari@alloymail.com> wrote in message
news:3f44ad7d@newsgroups.borland.com...
> Very thanks Rodolfo,
> Safari
Technical Details
Message-ID: <3f44e514@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3F425543.9040507@alloymail.com> <3f42a46c@newsgroups.borland.com> <3f44ad7d@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,7ce38efab0f8f813
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-21 08:32:29 PST
From: "Rodolfo Frino" <rodolfofrino@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3F425543.9040507@alloymail.com> <3f42a46c@newsgroups.borland.com> <3f44ad7d@newsgroups.borland.com>
Subject: Re: SHGetSpecialFolderLocation!
Date: Fri, 22 Aug 2003 01:28:56 +1000
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 203.206.22.183
Message-ID: <3f44e514@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1061479700 203.206.22.183 (21 Aug 2003 08:28:20 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail