低级键盘挂钩不在UI线程上 [英] Low level keyboard Hook not at UI thread
本文介绍了低级键盘挂钩不在UI线程上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想为键盘挂钩创建一个好的库.我使用SetWindowsHookEx方法,并且我注意到,如果我的应用程序的主线程忙,则应该在任何系统KeyDown事件中调用的方法hookProc都不会执行.我认为应该将钩子挂起,以便其他线程负责.那可能吗?我该怎么办?
I want to create a good library for keyboard hook. I use a method SetWindowsHookEx and I have noticed that method hookProc, which should be called at any system KeyDown event, is not executed if the main thread of my app is bussy. I think the hook shold be made so, that the other thread would be responsible for it. Is that possible? How can I do it?
推荐答案
查看全文