资源简介
低级键盘钩子的demo,WH_KEYBOARD_LL,试过WH_KEYBOARD发现全局的时候,win7下面部分好用,xp完全不管用,最后决定用低级的,比较简单,看看就能用。VS2010写的。编译后可直接运行。
代码片段和文件信息
#include
#define WM_GLOBALKEYBOARD WM_USER+100
HHOOK g_hKeyboardHook = NULL;
DWORD g_dwThreadID = 0;
LRESULT CALLBACK LowLevelKeyboardProc(
int nCode
WPARAM wParam
LPARAM lParam
)
{
// 按键释放为一个键值
if ( WM_KEYUP == wParam)
{
KBDLLHOOKSTRUCT* pKHook = (KBDLLHOOKSTRUCT*) lParam;
PostThreadMessage(g_dwThreadID WM_GLOBALKEYBOARD pKHook->vkCode pKHook->scanCode);
}
return CallNextHookEx(g_hKeyboardHook nCode wParam lParam);
}
void SetHook(DWORD dwThreadID)
{
HMODULE mod = GetModuleHandle(“KeyboardHookDLL.dll“); //获取当前DLL模块句柄
g_hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL LowLevelKeyboardProc mod 0);
g_dwThreadID = dwThreadID;
}
void DeleteHook()
{
UnhookWindowsHookEx(g_hKeyboardHook);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-02-18 11:00 KeyboardHookTest\Debug\
目录 0 2016-02-17 16:38 KeyboardHookTest\KeyboardHookDLL\
目录 0 2016-02-18 11:00 KeyboardHookTest\KeyboardHookDLL\Debug\
文件 3650 2016-02-18 11:00 KeyboardHookTest\KeyboardHookDLL\Debug\KeyboardHookDLL.Build.CppClean.log
文件 536 2016-02-18 11:00 KeyboardHookTest\KeyboardHookDLL\Debug\KeyboardHookDLL.log
文件 818 2016-02-18 10:55 KeyboardHookTest\KeyboardHookDLL\KeyboardHookDLL.cpp
文件 67 2016-02-17 14:36 KeyboardHookTest\KeyboardHookDLL\KeyboardHookDLL.def
文件 4277 2016-02-18 10:01 KeyboardHookTest\KeyboardHookDLL\KeyboardHookDLL.vcxproj
文件 1073 2016-02-17 14:36 KeyboardHookTest\KeyboardHookDLL\KeyboardHookDLL.vcxproj.filters
文件 143 2016-02-17 14:31 KeyboardHookTest\KeyboardHookDLL\KeyboardHookDLL.vcxproj.user
目录 0 2016-02-17 17:05 KeyboardHookTest\KeyboardHookDLL\Release\
文件 1902 2016-02-17 17:05 KeyboardHookTest\KeyboardHookDLL\Release\KeyboardHookDLL.Build.CppClean.log
文件 538 2016-02-17 17:05 KeyboardHookTest\KeyboardHookDLL\Release\KeyboardHookDLL.log
文件 1399 2016-02-17 14:33 KeyboardHookTest\KeyboardHookTest.sln
文件 20992 2016-02-18 11:01 KeyboardHookTest\KeyboardHookTest.suo
目录 0 2016-02-18 10:08 KeyboardHookTest\KeyboardHookTest\
目录 0 2016-02-18 11:00 KeyboardHookTest\KeyboardHookTest\Debug\
文件 4313 2016-02-18 11:00 KeyboardHookTest\KeyboardHookTest\Debug\KeyboardHookTest.Build.CppClean.log
文件 541 2016-02-18 11:00 KeyboardHookTest\KeyboardHookTest\Debug\KeyboardHookTest.log
文件 27488 2016-02-18 10:08 KeyboardHookTest\KeyboardHookTest\KeyboardHookTest.aps
文件 1851 2016-02-18 11:00 KeyboardHookTest\KeyboardHookTest\KeyboardHookTest.cpp
文件 39 2016-02-17 13:33 KeyboardHookTest\KeyboardHookTest\KeyboardHookTest.h
文件 3762 2016-02-18 10:04 KeyboardHookTest\KeyboardHookTest\KeyboardHookTest.rc
文件 4714 2016-02-18 10:17 KeyboardHookTest\KeyboardHookTest\KeyboardHookTest.vcxproj
文件 1841 2016-02-18 10:04 KeyboardHookTest\KeyboardHookTest\KeyboardHookTest.vcxproj.filters
文件 143 2016-02-17 13:33 KeyboardHookTest\KeyboardHookTest\KeyboardHookTest.vcxproj.user
文件 2110 2016-02-17 13:33 KeyboardHookTest\KeyboardHookTest\ReadMe.txt
目录 0 2016-02-17 17:05 KeyboardHookTest\KeyboardHookTest\Release\
文件 2647 2016-02-17 17:05 KeyboardHookTest\KeyboardHookTest\Release\KeyboardHookTest.Build.CppClean.log
文件 543 2016-02-17 17:05 KeyboardHookTest\KeyboardHookTest\Release\KeyboardHookTest.log
目录 0 2016-02-18 10:04 KeyboardHookTest\KeyboardHookTest\res\
............此处省略7个文件信息
- 上一篇:LM2940中文资料
- 下一篇:批量处理图片大小-小巧好用的图片处理工具
相关资源
- linux c select简单
- 窗体类名子元素标题获取工具
- APIhook实现数据包截获
- hook TrayClockWClass 系统时钟
- Winmm劫持源码 支持X64
- 最完整Hook的使用Demo
- 键盘钩子,无需使用DLL
- d3d hook模块
- 网络拦截器--winsock钩子
- win7系统使用钩子WH_JOURNALRECORD和WH_JO
- delphi钩子库
- 键盘钩子程序
- 小巧的网络防火墙
- hook更改硬盘序列号 转载
- 微信纯HOOK 易源码,无DLL ,想写机器
- win10 X64 可用的钩子函数库
- 键盘钩子HOOK
- UG NX 与 Opengl联合编程
- Win32 Hooks 钩子详细介绍
- 基于HOOK技术的本地打印监控系统开发
- 如何HOOK桌面窗口消息
- 利用钩子技术控制进程创建(源码)
- DLL注入HOOK进程按钮点击delphi
- hook wmi 修改机器码
- dll注入Hook
- easyhook库的使用
- SetWindowsHookEx Hook demo
- 拦截网络socket的数据
- Hook工具 监控任意窗体拦截消息
- HookNtQuery_File.zip
评论
共有 条评论