KeyHookApp.cpp
上传用户:hongsj123
上传日期:2022-06-18
资源大小:3192k
文件大小:0k
源码类别:

钩子与API截获

开发平台:

Visual C++

  1. #include <stdio.h>
  2. #include <windows.h>
  3. #include "KeyHookLib.h"
  4. #pragma comment(lib,"09KeyHookLib")
  5. int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
  6. {
  7. MSG msg;
  8. if (!SetKeyHooK(TRUE,0,NULL))
  9. {
  10. MessageBox(NULL,"SetKeyHook","安装钩子失败!",MB_OK);
  11. return TRUE;
  12. }
  13. while (::GetMessage(&msg,NULL,0,0))
  14. {
  15. //::TranslateMessage(&msg);
  16. //::DispatchMessage(&msg);
  17. }
  18. return msg.wParam;
  19. }