单独作为应用程序来调 底层键盘钩子的dll,没任何问题但是需要放到服务里面控制可能登陆的多个xp用户桌面切换桌面吗?何时切换?怎么弄?不起作用?为何?

解决方案 »

  1.   

    SetProcessWindowStation?
    SetThreadDesktop?
      

  2.   

    是不是LowLevelKeyboardProc和SetWindowsHookEx在服务里面用不行 ?
      

  3.   

    通常,NT服务是控制台应用程序,它没有消息循环。不知道下面的链接对你有没有帮助
    http://www.vckbase.com/document/viewdoc/?id=283
      

  4.   

    SetWindowsHookEx没有返回失败吧?
      

  5.   

    SetWindowsHookEx没有返回失败,就是不起作用
      

  6.   

    MSDN上说法:
    This hook is called in the context of the thread that installed it. The call is made by sending a message to the thread that installed the hook. Therefore, the thread that installed the hook must have a message loop. 所以你要在SetWindowsHookEx后,用GetMessage建立消息循环……