uses Registry;
procedure TaskMngr(enable: boolean);
var
reg: TRegistry;
begin
reg := TRegistry.Create;
reg.RootKey := HKEY_CURRENT_USER;
reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Policies\System', true);
if enable then reg.DeleteValue('DisableTaskMgr')
else reg.WriteString('DisableTaskMgr', '1');
reg.CloseKey;
end;
// Beispielaufruf
procedure TForm1.Button10Click(Sender: TObject);
begin
TaskMngr(false);
end;