Uses
Registry
procedure TMainFrm.SetAutoRun;var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
try
Reg.RootKey:=HKEY_LOCAL_MACHINE;
Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Run', True);
Reg.WriteString('Bosure.Q', ParamStr(0));
Reg.CloseKey;
finally
Reg.Free;
end;
end;
SetAutoRun(True);
SetAutoRun(False);
本文介绍了一种在Windows系统中通过注册表设置程序自启动的方法。使用Delphi编写了一个简单的程序,通过创建注册表键值来实现应用程序随系统启动而自动运行的功能。

被折叠的 条评论
为什么被折叠?



