Registriert seit: 7. Jan 2003
Ort: Menden
192 Beiträge
Delphi 7 Enterprise
|
Re: Mein Programm beim Windowsstart Automatisch starten
5. Jan 2005, 19:39
Delphi-Quellcode:
uses Registry;
procedure AddToAutoStart(KeyName, Filename : string);
var
Reg : TRegistry;
begin
Reg := TRegistry.Create;
Reg.RootKey := HKEY_LOCAL_MACHINE;
Reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run', false);
Reg.WriteString(KeyName, Filename);
Reg.Free;
end;
procedure RemoveFromAutoStart(KeyName: string);
var
Reg : TRegistry;
begin
Reg := TRegistry.Create;
Reg.RootKey := HKEY_LOCAL_MACHINE;
Reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run', false);
Reg.DeleteValue(KeyName);
Reg.Free;
end;
[Edit] Zu langsam [/Edit]
Christian Killing for peace is like fucking for virginity
Nightshade
|