Kod:
// Başlangıçta başlatmak için Registry'e yazar
procedure RunOnStartup(value:string);
var R:Tregistry;
begin
R:=TRegistry.Create;
R.RootKey:=HKEY_LOCAL_MACHINE;
R.OpenKey('\\Software\\Microsoft'
+ '\\Windows\\CurrentVersion\\Run',false);
R.WriteString(value,application.exename);
R.CloseKey;
R.free;
end;
// Az önce yazdığımız değeri silmek istersek:
procedure DoNotRunOnStartup(value:string);
var R:Tregistry;
begin
R:=TRegistry.Create;
R.RootKey:=HKEY_LOCAL_MACHINE;
R.OpenKey('\\Software\\Microsoft'
+ '\\Windows\\CurrentVersion\\Run',false);
if R.ValueExists(value) then
R.DeleteValue(value);
R.CloseKey;
R.free;
end;