C
chenxian5225427
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,registry; //增加库函数registrytype TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}//不要忘记增加库函数registry不然,嘿嘿^_^procedure TForm1.Button1Click(Sender: TObject);var a:tregistry;begin a:=tregistry.Create;//创建registry对象 a.RootKey:=HKEY_CURRENt_USER;//设置根键 a.OpenKey('software/microsoft/windows/CurrentVersion/run',false);//false表示不创建 //openkey打开注册表路径 a.WriteString('D:/QQ2009/Bin/QQ.exe',paramstr(0)); //把自己写入到启动中. a.Free;//释放对象end;end.问题:比如我想把QQ这个程序加入启动项中,为什么每次加入都是这个delphi的exe文件呢,我没有多少分了,关100嘛,谢谢大虾了