引用Registry单元
//禁止使用注册表
procedure TForm1.Button1Click(Sender: TObject);
const
Key='/SoftWare/Microsoft/Windows/CurrentVersion/Policies/System';
var
myReg:TRegistry;
begin
myReg:=TRegistry.Create;
with myRegdo
try
RootKey:=HKEY_CURRENT_USER;
OpenKey(Key,True);
WriteInteger('DisableRegistryTools',1);
finally
free;
end;
end;
//允许使用注册表
procedure TForm1.Button2Click(Sender: TObject);
const
Key='/SoftWare/Microsoft/Windows/CurrentVersion/Policies/System';
var
myReg:TRegistry;
begin
myReg:=TRegistry.Create;
with myRegdo
try
RootKey:=HKEY_CURRENT_USER;
OpenKey(Key,True);
WriteInteger('DisableRegistryTools',0);
finally
free;
end;
end;