资 源 简 介
Delphi 键盘钩子 封锁 windows 热键,封锁范围,可参见以下代码:
keycost := LPKBDLLHOOKSTRUCT(lParam);
if (keycost.vkCode=91) then//封锁win键
exit;
if (keycost.vkCode=VK_ESCAPE) and (GetAsyncKeyState(VK_CONTROL)<0) then
exit; //封锁 CTRL+ESC
if (keycost.vkCode=VK_TAB) and (( LLKHF_ALTDOWN and keycost.flags)>0) then
exit; //封锁 ALT+TAB
if (keycost.vkCode=115) and ((keycost.flags and LLKHF_ALTDOWN)>0) then
exit; //封锁 ALT+F4
if (keycost.vkCode=VK_ESCAPE) and ((keycost.flags and LLKHF_ALTDOWN)>0) then
exit; //封锁 ALT+ESC
if (keycost.vkCode=VK_SPACE) and (GetAsyncKeyState(VK_CONTROL)<0) then
exit; //封锁 CTRL+
if (keycost.vkCode=VK_SNAPSHOT) then
exit; //封锁 Print Screen
if(keycost.vkCode=164) then
exit;