, , , , , .
, Windows (, ), :
- , .
- , , (Ctrl, Alt, F1-F12, Windows, Menu)
, Ctrl + Alt + Del, .
uses
Windows;
var
hKeybaordHook: HHOOK = 0;
function KeyboardHook(nCode: Integer; wParam: WPARAM; lParam: LPARAM): HRESULT; stdcall;
type
PKBDLLHOOKSTRUCT = ^TKBDLLHOOKSTRUCT;
TKBDLLHOOKSTRUCT = packed record
vkCode: DWORD;
scanCode: DWORD;
flags: DWORD;
time: DWORD;
dwExtraInfo: DWORD;
end;
const
LLKHF_ALTDOWN = $20;
var
pkbhs: PKBDLLHOOKSTRUCT;
begin
pkbhs := PKBDLLHOOKSTRUCT(lParam);
if nCode = HC_ACTION then
begin
Result := 1;
if WordBool(GetAsyncKeyState(VK_CONTROL) and $8000) then Exit
else if LongBool(pkbhs^.flags and LLKHF_ALTDOWN) then Exit
else if (pkbhs^.vkCode = VK_LWIN) or (pkbhs^.vkCode = VK_RWIN) then Exit
else if bDisableFunctionKeys and (pkbhs^.vkCode >= VK_F1) and (pkbhs^.vkCode <= VK_F24) then Exit;
{
else if (pkbhs^.vkCode = VK_ESCAPE) and WordBool(GetAsyncKeyState(VK_CONTROL) and $8000) then Exit
else if (pkbhs^.vkCode = VK_TAB) and LongBool(pkbhs^.flags and LLKHF_ALTDOWN) then Exit
else if (pkbhs^.vkCode = VK_ESCAPE) and LongBool(pkbhs^.flags and LLKHF_ALTDOWN) then Exit
}
end;
Result := CallNextHookEx(hKeybaordHook, nCode, wParam, lParam);
end;
procedure MainForm.FormShow(Sender: TObject);
const
WH_KEYBOARD_LL = 13;
begin
SetBounds(0, 0, Screen.Width, Screen.Height);
if hKeybaordHook = 0 then
hKeybaordHook := SetWindowsHookEx(WH_KEYBOARD_LL, @KeyboardHook, HInstance, 0);
end;
procedure MainForm.FormHide(Sender: TObject);
begin
if (hKeybaordHook <> 0) and UnhookWindowsHookEx(hKeybaordHook) then
hKeybaordHook := 0;
end;
"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe" , ( Ctrl + Shift + Esc).