Delphi写入注册表使muma.exe随Windows启动而自动运行问题!
我在窗体里新建一个按钮加入如下代码:______________________________________________________________
procedure TForm1.Button1Click(Sender: TObject);
var
ARegistry : TRegistry;
begin
ARegistry := TRegistry.Create;//建立一个TRegistry实例
with ARegistry do
begin
RootKey:=HKEY-LOCAL-MACHINE;
if OpenKey(′Software′,True) then
WriteString(′delphi′,′C:muma.exe′);
CloseKey;
Destroy;
end;
end;
_________________________________________________________________
ARegistry : TRegistry; //提示错误这是为什么?是不是我没建什么控件?
请前辈们指教!