Examples Delphi

-disable keyboard
winexec(Pchar('rundll32 keyboard,disable'),sw_Show);
(NO ENABLE)
or
-keyboard disable
begin
Asm
in al,21h
or al,00000010b
out 21h,al
End;
-----------------------------------------------------------
-keyboard enable
begin
Asm
in al,21h
mov al,0
out 21h,al
End;
-------------------------------------------------------------
-disable CTRL + ALT + DEL
var
dummy : integer;

SystemParametersInfo( SPI_SCREENSAVERRUNNING, 1, @dummy, 0);
-------------------------------------------------------------
-enable CTRL + ALT + DEL
var
dummy : integer;

SystemParametersInfo( SPI_SCREENSAVERRUNNING, 0, @dummy, 0);
--------------------------------------------------------------
-num lock control
procedure TForm1.Button1Click(Sender: TObject);
var KeyState: TKeyboardState;
begin
GetKeyboardState(KeyState);
if (KeyState[VK_NUMLOCK] = 0)
then KeyState[VK_NUMLOCK] := 1
else KeyState[VK_NUMLOCK] := 0;
SetKeyboardState(KeyState);
end;
---------------------------------------------------------------
-caps lock control
procedure TForm1.Button3Click(Sender: TObject);
var KeyState: TKeyboardState;
begin
GetKeyboardState(KeyState);
if (KeyState[vk_capital] = 0)
then KeyState[vk_capital] := 1
else KeyState[vk_capital] := 0;
SetKeyboardState(KeyState);
end;
----------------------------------------------------------------
-scroll lock control
procedure TForm1.Button2Click(Sender: TObject);
var KeyState: TKeyboardState;
begin
GetKeyboardState(KeyState);
if (KeyState[vk_Scroll] = 0)
then KeyState[vk_Scroll] := 1
else KeyState[vk_Scroll] := 0;
SetKeyboardState(KeyState);
end;