关于开机自动运行程序! 怎么才能让机器开机时就能自动运行我的程序而且要在注册表里注册! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 给你贴一段代码,用CheckBox设置是否自启动,用按钮确认或取消:procedure TfrmAutoRun.btnOkClick(Sender: TObject);var rAutoRun: TRegistry;begin rAutoRun := TRegistry.Create; rAutoRun.RootKey := HKEY_LOCAL_MACHINE; try rAutorun.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run', true); if cbAutoRun.Checked = true then begin rAutorun.WriteString('firApp', ExpandFileName(Application.ExeName)); MessageBox(self.Handle, '自启动设置成功!', '提示', mb_iconInformation + mb_Ok) end else begin if rAutoRun.ValueExists('firApp') then begin rAutoRun.DeleteValue('firApp'); cbAutoRun.Checked := false; MessageBox(self.Handle, '自启动已取消!', '提示', mb_iconInformation + mb_Ok) end; end; finally rAutoRun.CloseKey; rAutoRun.Free; end;end; 窗体创建时读注册表值以设定CheckBox状态:procedure TfrmAutoRun.FormShow(Sender: TObject);var rAutoRun: TRegistry;begin rAutoRun := TRegistry.Create; rAutoRun.RootKey := HKEY_LOCAL_MACHINE; try rAutorun.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run', false); if rAutoRun.ValueExists('firApp') then cbAutoRun.Checked := true else cbAutoRun.Checked := false; finally rAutoRun.CloseKey; rAutoRun.Free; end;end; 生成一个快捷方式,然后COPY到....../程序/启动/ 文件夹 中 delphi 怎样将ucs2编码转换成中文 菜鸟控件问题 在做好了软件后,如何打包?打什么进去? Access 删除记录的问题! 求教TNMFTP的问题 请问高手:我想把一个部门的成员调到另一部门,最好用什么控件表示比较简单直观? 别人给了我上百分,为什么我的可用分还是原来的没变!!! 谁可以提供一些关于新闻组编程的资料! Delphi中的DBE中的用户名和密码是什么???????? 各位高手,请告诉我DELPHI,C++BUILDER该选哪一个? 怎样得到GRID中现在正在输入的值? TChart的简单问题!
var
rAutoRun: TRegistry;
begin
rAutoRun := TRegistry.Create;
rAutoRun.RootKey := HKEY_LOCAL_MACHINE; try
rAutorun.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run', true); if cbAutoRun.Checked = true then
begin
rAutorun.WriteString('firApp', ExpandFileName(Application.ExeName));
MessageBox(self.Handle, '自启动设置成功!', '提示', mb_iconInformation + mb_Ok)
end
else
begin
if rAutoRun.ValueExists('firApp') then
begin
rAutoRun.DeleteValue('firApp');
cbAutoRun.Checked := false;
MessageBox(self.Handle, '自启动已取消!', '提示', mb_iconInformation + mb_Ok)
end;
end;
finally
rAutoRun.CloseKey;
rAutoRun.Free;
end;
end;
var
rAutoRun: TRegistry;
begin
rAutoRun := TRegistry.Create;
rAutoRun.RootKey := HKEY_LOCAL_MACHINE; try
rAutorun.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run', false); if rAutoRun.ValueExists('firApp') then
cbAutoRun.Checked := true
else
cbAutoRun.Checked := false;
finally
rAutoRun.CloseKey;
rAutoRun.Free;
end;
end;