Article View: borland.public.cppbuilder.nativeapi
Article #12402Re: Remove program from windows startup problem
From: Martin C
Date: Sat, 06 Dec 2003 21:49
Date: Sat, 06 Dec 2003 21:49
29 lines
1835 bytes
1835 bytes
Remy, I tried using HKEY_CURRENT_USER but I still have a problem removing
the program from the startup list
here is the code I use to remove the program from the startup list:
TRegistry *Registry = new TRegistry;
try
{
Registry->RootKey = HKEY_CURRENT_USER;
Registry->Access=KEY_ALL_ACCESS;
AnsiString TheProgramID = Application->ExeName;
if(Registry->OpenKey("\\Software\\Microsoft\\Windows\\CurrentVersion\\Run",
false)==true)
{
Registry->DeleteKey("Project1");
}
else
{
}
}
catch(ERegistryException &E)
{
}
delete Registry;
Whenever I try to execute this code, nothing happens and the program is not
removed from the windows startup list
Technical Details
Message-ID:
<3fd24ef6@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-out.visi.com!petbe.visi.com!ash.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3fd0ed25@newsgroups.borland.com> <3fd0f248$1@newsgroups.borland.com> <3fd0fdbe@newsgroups.borland.com> <3fd1013d$1@newsgroups.borland.com> <3fd10591@newsgroups.borland.com> <3fd154d6$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,ff7b3ea91fca4aca X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-12-06 14:01:30 PST From: "Martin C" <martinc@aol.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3fd0ed25@newsgroups.borland.com> <3fd0f248$1@newsgroups.borland.com> <3fd0fdbe@newsgroups.borland.com> <3fd1013d$1@newsgroups.borland.com> <3fd10591@newsgroups.borland.com> <3fd154d6$1@newsgroups.borland.com> Subject: Re: Remove program from windows startup problem Date: Sat, 6 Dec 2003 13:49:40 -0800 Lines: 31 Organization: V Safe 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: 81.10.4.238 Message-ID: <3fd24ef6@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1070747382 81.10.4.238 (6 Dec 2003 13:49:42 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-out.visi.com!petbe.visi.com!ash.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail