閺€鎯版 (0) +1 鐠э拷 (0) +1 闊拷 (0) +1
閺€鎯版閹存劕濮�閺屻儳婀呴弨鎯版>>

正在阅读:不依赖于DLL就能工作的全局钩子不依赖于DLL就能工作的全局钩子

2004-03-25 14:32 出处:CSDN 作者:xstring 责任编辑:linjixiong


  GetModuleHandle (NULL), // 不能为NULL,否则失败

  0);

  if (g_kb_hook == NULL)

  {

  fprintf (stderr,

  "SetWindowsHookEx failed with error %d\n",

  ::GetLastError ());

  return 0;

  };

  // 消息循环是必须的,想知道原因可以查msdn

  MSG msg;

  while (GetMessage (&msg, NULL, 0, 0))

  {

  TranslateMessage (&msg);

  DispatchMessage (&msg);

  };

  UnhookWindowsHookEx (g_kb_hook);

  return 0;

  };



察看评论详细内容 我要发表评论
作者笔名简短内容 发表时间
:
键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品
閹靛婧€鐠佸潡妫�閸ョ偛鍩屾い鍫曞劥