🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: WinXP/ ?2K? Question

#16486
From: user
Date: Sat, 10 May 2003 13:34
26 lines
2217 bytes
Eric Hobbs wrote:
> Hello All, I think this is the best group for this so here goes, on 
> WinXP and posibly 2K, the START menu displays a list of the most 
> commonly used apps, how would I go about adding my application to it.
> Thanks In Advance.
> 

That's the sort of thing that would usually be done by an installer or 
manually using the Windows UI, but if you need to do it using the 
Windows API you can
1. Call SHGetSpecialFolderPath using a CSIDL of either 
CSIDL_COMMON_STARTMENU or CSIDL_STARTMENU to determine the location of 
the Start Menu folder for all users or the current user.
2. Use the IShellLink COM object to create a shortcut to your 
application in that folder.

There's sample code for part 2 in the PSDK help file under User 
Interface Services/Windows Shell/Intermediate Shell 
Techniques/Intermediate Shell Techniques: Programming the Shell/Creating 
Shortcuts/Shell Links, or online at http://tinyurl.com/bfrm.

It may be heretical to say here, but I wouldn't use the Windows API for 
a task like this if I could avoid it. You could write a Windows Script 
in a fraction of the time because the WshShell has a SpecialFolders 
array and a CreateShortcut function that shield you from all the ugly 
COM work.
Technical Details
Message-ID: <3EBCFFC8.3070609@domain.invalid>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3E883BA2.6050805@Netscape.Net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,bbeb6d1453aadba8
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-05-10 06:42:15 PST
Message-ID: <3EBCFFC8.3070609@domain.invalid>
Date: Sat, 10 May 2003 09:34:00 -0400
From:  user@domain.invalid
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: Re: WinXP/ ?2K? Question
References: <3E883BA2.6050805@Netscape.Net>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 151.201.32.85
X-Trace: newsgroups.borland.com 1052573662 151.201.32.85 (10 May 2003 06:34:22 -0700)
Lines: 27
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail