收藏 (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;

  };



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

关注我们

最新资讯离线随时看 聊天吐槽赢奖品
手机访问回到顶部