var Reg: TRegistry; begin Reg := TRegistry.Create; try Reg.RootKey := HKEY_CURRENT_USER; if Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run', True) then begin Reg.WriteString('JCDataSyn', Application.ExeName); Reg.CloseKey; end; finally Reg.Free; inherited; end; end;
请问cooltrayicon在哪个控件包里啊
var reg:Tregistry; vDataBase,RunPath : String; begin reg:=Tregistry.create; reg.rootkey:=HKEY_CURRENT_USER; if reg.openkey('\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN',True) then begin vDataBase := reg.ReadString('AutoUpdate'); RunPath:=ExtractFileDir(Application.ExeName); RunPath:=Runpath+'\PosAutoUpdate.exe'; if (vDataBase='') or (vDataBase<>RunPath) then reg.WriteString('AutoUpdate',RunPath); reg.closekey; end; Reg.Free; end;
Reg: TRegistry;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
if Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run', True) then begin
Reg.WriteString('JCDataSyn', Application.ExeName);
Reg.CloseKey;
end;
finally
Reg.Free;
inherited;
end;
end;
reg:Tregistry;
vDataBase,RunPath : String;
begin
reg:=Tregistry.create;
reg.rootkey:=HKEY_CURRENT_USER;
if reg.openkey('\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN',True) then
begin
vDataBase := reg.ReadString('AutoUpdate');
RunPath:=ExtractFileDir(Application.ExeName);
RunPath:=Runpath+'\PosAutoUpdate.exe';
if (vDataBase='') or (vDataBase<>RunPath) then
reg.WriteString('AutoUpdate',RunPath);
reg.closekey;
end;
Reg.Free;
end;