KeyHookApp.cpp
资源名称:HookKey.rar [点击查看]
上传用户:hongsj123
上传日期:2022-06-18
资源大小:3192k
文件大小:0k
源码类别:
钩子与API截获
开发平台:
Visual C++
- #include <stdio.h>
- #include <windows.h>
- #include "KeyHookLib.h"
- #pragma comment(lib,"09KeyHookLib")
- int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
- {
- MSG msg;
- if (!SetKeyHooK(TRUE,0,NULL))
- {
- MessageBox(NULL,"SetKeyHook","安装钩子失败!",MB_OK);
- return TRUE;
- }
- while (::GetMessage(&msg,NULL,0,0))
- {
- //::TranslateMessage(&msg);
- //::DispatchMessage(&msg);
- }
- return msg.wParam;
- }