function LowLevelKeyBoardProc(nCode: Integer; awParam: WPARAM; alParam: LPARAM): LRESULT; stdcall;
implementation
function LowLevelKeyBoardProc(nCode: Integer; awParam: WPARAM; alParam: LPARAM): LRESULT; stdcall;
var
fEatKeyStroke: Boolean;
p: PKBDLLHOOKSTRUCT;
begin
fEatKeystroke := False;
if nCode = HC_ACTION then
begin
case awParam of
WM_KEYDOWN,
WM_SYSKEYDOWN,
WM_KEYUP,
WM_SYSKEYUP:
begin
p := PKBDLLHOOKSTRUCT(alParam);
if ((p^.flags and LLKHF_ALTDOWN) <> 0) and ((GetKeyState(VK_CONTROL) and $8000) <> 0) then
fEatKeystroke := True;
if ((p^.flags and LLKHF_ALTDOWN) <> 0) and (p^.vkCode = VK_ESCAPE) then
fEatKeystroke := True;
if ((p^.flags and LLKHF_ALTDOWN) <> 0) and (p^.vkCode = VK_TAB) then
fEatKeystroke := True;
if ((p^.Flags and LLKHF_ALTDOWN) <> 0) and (p^.vkCode = VK_SPACE) then
fEatKeyStroke := True;
if ((GetKeyState(VK_CONTROL) and $8000) <> 0) and (p^.vkCode = VK_ESCAPE) then
fEatKeystroke := True;
if p^.vkCode = VK_LWIN then
fEatKeystroke := True;
end;
end;
end;
if fEatKeyStroke then
Result := 1
else
Result := CallNextHookEx(hhkLowLevelKybd, nCode, awParam, alParam);
end;