Disable Ctrl+Alt+Del

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Registry;

type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure DisableCtrAltDel(Val: Boolean);
var
MyReg: TRegistry;
begin
MyReg := TRegistry.Create;
with MyReg do
begin
RootKey := HKEY_CURRENT_USER;
OpenKey(‘\Software\Microsoft\Windows\CurrentVersion\Policies\System’, True);
if Val then
Myreg.WriteString(‘DisableTaskMgr’, ‘1’)
else
Myreg.DeleteValue(‘DisableTaskMgr’);
Myreg.CloseKey;
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
DisableCtrAltDel(True);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
DisableCtrAltDel(False);
end;

end.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: