• 大小: 0.96M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-29
  • 语言: C/C++
  • 标签: 键盘  测试  

资源简介


资源截图

代码片段和文件信息

#include  

HWND g_hwnd = NULL; // 对话框全局句柄,用于向对话框传递截取的消息
//HHOOK g_hMouse = NULL;
HHOOK g_hKeyboard = NULL;

/*
LRESULT CALLBACK MouseProc(int nCode WPARAM wParam LPARAM lParam)
{
MOUSEHOOKSTRUCT* Mouse_Info = (MOUSEHOOKSTRUCT*)lParam;
if (HC_ACTION == nCode)
if (WM_LBUTTONDOWN == wParam)
return 1;
return CallNextHookEx(g_hMouse nCode wParam lParam); // 回调
}
*/

LRESULT CALLBACK KeyboardProc(int nCode WPARAM wParam LPARAM lParam)
{
KBDLLHOOKSTRUCT *Key_Info = (KBDLLHOOKSTRUCT*)lParam;
if (HC_ACTION == nCode)
{
if (WM_KEYDOWN == wParam || WM_SYSKEYDOWN == wParam
/*|| WM_KEYUP == wParam || WM_SYSKEYUP ==wParam*/) // 不可加上UP,否者键名不对
{
switch(Key_Info->vkCode)
{
case VK_LWIN: // 防止弹出系统菜单
case VK_RWIN:
case VK_SNAPSHOT: // 如果被系统截取,则只有Keyup,没有Ke

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         143  2014-07-21 18:59  .gitignore
     目录           0  2014-07-21 14:42  Exe\
     文件        7168  2014-07-21 11:34  Exe\Filter.dll
     文件     1699840  2014-07-21 11:50  Exe\KeyTest.exe
     文件       18025  2014-07-21 18:59  LICENSE
     文件         346  2014-07-21 18:59  README.md
     目录           0  2014-07-21 18:59  VS2010Solution\
     目录           0  2014-07-21 18:59  VS2010Solution\Filter\
     文件        2185  2014-07-21 18:59  VS2010Solution\Filter\Filter.cpp
     文件          39  2014-07-21 18:59  VS2010Solution\Filter\Filter.def
     文件        4080  2014-07-21 18:59  VS2010Solution\Filter\Filter.vcxproj
     文件        1029  2014-07-21 18:59  VS2010Solution\Filter\Filter.vcxproj.filters
     文件         141  2014-07-21 18:59  VS2010Solution\Filter\Filter.vcxproj.user
     目录           0  2014-07-21 18:59  VS2010Solution\KeyTest\
     文件        1319  2014-07-21 18:59  VS2010Solution\KeyTest.sln
     文件       24064  2014-07-21 18:59  VS2010Solution\KeyTest.suo
     文件       27434  2014-07-21 18:59  VS2010Solution\KeyTest\KetTest.rc
     文件       98496  2014-07-21 18:59  VS2010Solution\KeyTest\KeyTest.aps
     文件        1881  2014-07-21 18:59  VS2010Solution\KeyTest\KeyTest.cpp
     文件         417  2014-07-21 18:59  VS2010Solution\KeyTest\KeyTest.h
     文件       27320  2014-07-21 18:59  VS2010Solution\KeyTest\KeyTest.rc
     文件        5795  2014-07-21 18:59  VS2010Solution\KeyTest\KeyTest.vcxproj
     文件        1930  2014-07-21 18:59  VS2010Solution\KeyTest\KeyTest.vcxproj.filters
     文件         375  2014-07-21 18:59  VS2010Solution\KeyTest\KeyTest.vcxproj.user
     文件       25710  2014-07-21 18:59  VS2010Solution\KeyTest\KeyTestDlg.cpp
     文件        3287  2014-07-21 18:59  VS2010Solution\KeyTest\KeyTestDlg.h
     文件         174  2014-07-21 18:59  VS2010Solution\KeyTest\log.txt
     文件        2795  2014-07-21 18:59  VS2010Solution\KeyTest\ReadMe.txt
     目录           0  2014-07-21 18:59  VS2010Solution\KeyTest\res\
     文件       12860  2014-07-21 18:59  VS2010Solution\KeyTest\resource.h
     文件       67777  2014-07-21 18:59  VS2010Solution\KeyTest\res\KeyTest.ico
............此处省略5个文件信息

评论

共有 条评论