dll 钩子失败解决办法

dll 钩子失败
在dll 中有一个SetWindowshookEx
用一个普通程序加载dll ,一切正常,
用一个服务程序加载该dll ,dll 加强载成功,但是里面的全局钩子失败,怎么解决


------解决方案--------------------
正常的,服务程序与普通程序不在同一个桌面下,钩子与消息之类的都不能共用。
MSDN上的说法:The global hooks are a shared resource, and installing one affects all applications in the same desktop as the calling thread.
------解决方案--------------------
CreateProcess不能指定token
只能另开进程才能运行在不同的会话,不同的桌面