找到一个关于屏蔽的,不知运行程序和10秒内有效 怎么弄?- LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
- {
- BOOL fEatKeystroke = FALSE;
- PKBDLLHOOKSTRUCT p = NULL;
-
- if (nCode == HC_ACTION)
- {
- p = (PKBDLLHOOKSTRUCT) lParam;
- switch (wParam)
- {
- case WM_KEYDOWN:
- case WM_SYSKEYDOWN:
- case WM_KEYUP:
- case WM_SYSKEYUP:
- fEatKeystroke = (p->vkCode == VK_LWIN) ¦ ¦ (p->vkCode == VK_RWIN) ¦ ¦ // 屏蔽Win
- // 屏蔽Alt+Tab
- ((p->vkCode == VK_TAB) && ((p->flags & LLKHF_ALTDOWN) != 0)) ¦ ¦
- // 屏蔽Alt+Esc
- ((p->vkCode == VK_ESCAPE) && ((p->flags & LLKHF_ALTDOWN) != 0)) ¦ ¦
- // 屏蔽Ctrl+Esc
- ((p->vkCode == VK_ESCAPE) && ((GetKeyState(VK_CONTROL) & 0x8000) != 0));
- break;
- default:
- break;
- }
- }
-
- return (fEatKeystroke ? TRUE : CallNextHookEx(glhHook,nCode,wParam,lParam));
- }
复制代码
|