🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Pin to Start Menu in Win XP

#14564
From: Rodolfo Frino
Date: Thu, 07 Aug 2003 14:38
51 lines
2454 bytes
Hi Simon,

I use this function to do that

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

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

        if (SHGetPathFromIDList(pID_List, SpecialFolderPath))
            return String(SpecialFolderPath);
    }

    // Error
    // Example: if the location specified by the pidl parameter
    // is not part of the file system.
    return "";
}


void __fastcall TForm1::Button1Click(TObject *Sender)
{
       // Calls
       String S1 = GetSpecialFolderPath(Form1->Handle, CSIDL_STARTUP);
       String S2 = GetSpecialFolderPath(Form1->Handle, CSIDL_STARTMENU);
       String S3 = GetSpecialFolderPath(Form1->Handle, CSIDL_PROGRAMS);
       String S4 = GetSpecialFolderPath(Form1->Handle, CSIDL_DESKTOP);
}

I hope it helps

Rodolfo

"Simon Macneall" <macneall-at-iinet.net.au> wrote in message
news:Xns93D0A873E881Bmacnealliinetnetau@207.105.83.65...
> Hi all,
>
> We are trying to get our installer to pin our shortcut to the start menu
in
> Win XP. We can do it manually, but can't find anywhere that this info is
> stored. Can anyone shed any light?
>
> Thanks
> Simon
>
> PS - sorry for the non-borlandness of the question, but if it is any
> consolation the app we are installing is written using BCB.
Technical Details
Message-ID: <3f326472@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.gamma.ru!Gamma.RU!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <Xns93D0A873E881Bmacnealliinetnetau@207.105.83.65>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,b97b31609f4c69f3
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-07 07:40:34 PST
From: "Rodolfo Frino" <rodolfofrino@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <Xns93D0A873E881Bmacnealliinetnetau@207.105.83.65>
Subject: Re: Pin to Start Menu in Win XP
Date: Fri, 8 Aug 2003 00:38:39 +1000
Lines: 53
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.17.28
Message-ID: <3f326472@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1060267122 203.206.17.28 (7 Aug 2003 07:38:42 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.gamma.ru!Gamma.RU!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail