procedure DisableCtrAltDel(Val: Boolean);
var
MyReg: TRegistry;
begin
Try
MyReg := TRegistry.Create;
with MyReg do
begin
RootKey := HKEY_CURRENT_USER;
OpenKey('\Software\Microsoft\Windows\CurrentVersion\Policies\System', True);
if Val then
WriteString('DisableTaskMgr', '1')
else
DeleteValue('DisableTaskMgr');
CloseKey;
end;
Finally
MyReg.Free;
End;
end;
Contoh pemanggilan:
procedure TForm1.btn1Click(Sender: TObject);
begin
//disable
DisableCtrAltDel(True);
end;
procedure TForm1.btn2Click(Sender: TObject);
begin
//enable
DisableCtrAltDel(false);
end;
0 comments:
Post a Comment