Sunday, December 21, 2008

Delphi > Procedure Disable Ctrl Alt Del

procedure DisableCtrlAltDel(BDisable:Boolean);
const
VAL_DisableTaskMgr='DisableTaskMgr';
var
MyW: Word;
begin
if Win32Platform = VER_PLATFORM_WIN32_NT then
Begin
with Tregistry.Create do try
RootKey:=HKEY_CURRENT_USER;
OpenKey(RegSystemKey,TRUE);
IF Bdisable=true then
WriteInteger(VAL_DisableTaskMgr,1)
else
DeleteValue(VAL_DisableTaskMgr);
CloseKey;
finally
Free;
end;
end
else
begin
// hanya untuk windows 95 / NT 4.0
if BDisable then
begin
{Disable ALT-TAB}
SystemParametersInfo( SPI_SETFASTTASKSWITCH, 1, @Myw, 0);
{Disable CTRL-ALT-DEL}
SystemParametersInfo( SPI_SCREENSAVERRUNNING, 1, @Myw, 0);
end
else
begin
{Enable ALT-TAB}
SystemParametersInfo( SPI_SETFASTTASKSWITCH, 0, @Myw, 0);
{Enable CTRL-ALT-DEL}
SystemParametersInfo( SPI_SCREENSAVERRUNNING, 0, @Myw, 0);
end;
end;
end;

Seja o primeiro a comentar

Post a Comment

Latest Comments

About Me

My photo
Makassar, Sulawesi Selatan, Indonesia

Guest Book


ShoutMix chat widget

Script Sense ©Template Blogger Green by Dicas Blogger.

TOPO