Re: Start program when Vista starts



After Googling for a while, I found the Delphi equivalent (see below)
of the function I showed in my previous message. However, this
procedure, like CreateShellLink, also works on XP but on Vista I get a
'Failed to set data for myprog.exe' message. Any advice on how to solve
this issue on Vista will be appreciated.

------------

SetAutoStart(ParamStr(0), 'myprog.exe', True)

procedure SetAutoStart(AppName, AppTitle: string; bRegister: Boolean);
const
RegKey = '\Software\Microsoft\Windows\CurrentVersion\Run';
var
Registry: TRegistry;
begin
Registry := TRegistry.Create;
try
Registry.RootKey := HKEY_LOCAL_MACHINE;
if Registry.OpenKey(RegKey, False) then
begin
if bRegister = False then
Registry.DeleteValue(AppTitle)
else
Registry.WriteString(AppTitle, AppName);
end;
finally
Registry.Free;
end;
end;

--------

--
Brad Blanchard
http://www.braser.com

.



Relevant Pages

  • Re: Sfio functions in wdm.h
    ... bandwidth reservation feature in Vista, googling for that should give you ... None of this will lead you to documents explaining the usage of these ...
    (microsoft.public.development.device.drivers)
  • Re: OS: Windows XP is MUCH better than Windows Vista
    ... Apparently my product code is not valid for vista, so if i need to contact ... benchmarks on an average of 43.67% faster than windows vista. ... As of today, googling "VISTA SUCKS" gets 182,000 hits. ...
    (microsoft.public.windowsupdate)
  • Re: Ask EU Technical Section: Networking questions
    ... In message, Martin Clark writes: ... just come up against blank walls with this, and Googling has so far just led me to lots of other people having trouble sharing files between XP and Vista. ... Vista and XP playing together" bit. ...
    (uk.media.radio.archers)
  • Re: OS: Windows XP is MUCH better than Windows Vista
    ... Windows Vista truly does suck hind tit, many say it's a downgrade from ... As of today, googling "VISTA SUCKS" gets 182,000 hits. ... googling "VISTA SUCKS" in groups gets 2150 hits. ...
    (microsoft.public.windowsupdate)