Topic: [Script] Run project on Windows startup
You can make the settings for your program, so that it can start automatically when you start Windows.
procedure Form1_OnShow (Sender: string; Action: string);
var
reg: TRegistry;
begin
reg := TRegistry.Create;
reg.Access := KEY_ALL_ACCESS;
reg.RootKey := HKEY_CURRENT_USER;
reg.OpenKey('software\Microsoft\Windows\CurrentVersion\Run',true);
Form1.CheckBox1.Checked := reg.ValueExists('MyProjectMVD');
reg.CloseKey;
reg.Free;
end;
procedure Form1_OnClose (Sender: string; Action: string);
var
reg: TRegistry;
begin
reg := TRegistry.Create;
reg.Access := KEY_ALL_ACCESS;
reg.RootKey := HKEY_CURRENT_USER;
reg.OpenKey('software\Microsoft\Windows\CurrentVersion\Run',true);
if Form1.CheckBox1.Checked then
reg.WriteString('MyProjectMVD', '"'+Application.ExeName+'"')
else reg.DeleteValue('MyProjectMVD');
reg.CloseKey;
reg.Free;
end;
begin
end.
Download project:
http://myvisualdatabase.com/forum/misc. … download=1
Dmitry.