标签:
在设置窗体中 chkAutoStart: TCheckBox;
procedure TFrmSetup.FormCreate(Sender: TObject);
Var s:String;
_RootKey: HKEY;
_Localkey: String;
begin
{$ifdef Proxy}
btnAbout.Enabled :=False;
{$endif}
_RootKey:=HKEY_LOCAL_MACHINE;
_LocalKey:=‘software\microsoft\windows\currentversion\run‘;
chkAutoStart.Checked :=RegistryValueExist(_RootKey,_Localkey,‘AutoTvStart‘,application.ExeName);
end;
procedure TFrmSetup.chkAutoStartClick(Sender: TObject); //点击TCheckBox时;
Var _RootKey: HKEY;
_Localkey: String;
begin
_RootKey:=HKEY_LOCAL_MACHINE;
_LocalKey:=‘software\microsoft\windows\currentversion\run‘;
if chkAutoStart.Checked then
AddOneRegistryValue(_RootKey,_Localkey,‘AutoTask‘, Application.ExeName)
else
DeleteOneRegistryValue(_RootKey, _Localkey,‘AutoTask‘);
end;
设置随机启动--《用delphi开发共享软件》-15.1任务管理器
标签:
原文地址:http://www.cnblogs.com/rogge7/p/4460886.html