Hack Forums
[Delphi] Disable And Enable Task Manager - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5)
+---- Thread: [Delphi] Disable And Enable Task Manager (/showthread.php?tid=5727999)



Disable And Enable Task Manager - Xogg - Sep 30, 2017

Code
Procedure TaskManager(Disable: boolean);
Var
  R: TRegistry;
begin
  // Written By Dexuh
  if Disable then
  begin
    R := TRegistry.Create;
    R.RootKey := HKEY_CURRENT_USER;
    if R.OpenKey('Software\Microsoft\Windows\CurrentVersion\Policies\System', True) then  R.WriteString('DisableTaskMgr', '1');
  end
  else
  Begin
    R := TRegistry.Create;
    R.RootKey := HKEY_CURRENT_USER;
    if R.OpenKey ('Software\Microsoft\Windows\CurrentVersion\Policies\System', True) then R.DeleteValue('DisableTaskMgr');
  End;

end;

How to use this procedure

Be sure to add Registry to your uses statements.

Disable:
Code
TaskManager(True);

Enable:
Code
TaskManager(False);



* - Volty - Sep 30, 2017

If I remember correctly, there is a very similar key for disabling/enabling cmd.exe and regedit.exe


* - Xogg - Sep 30, 2017

(Sep 30, 2017 03:59 PM)Volty Wrote:  If I remember correctly, there is a very similar key for disabling/enabling cmd.exe and regedit.exe

I think there is.