SetWindowsHookEx()WM_KEYBOARD_LL不与全屏RDC一起通过 [英] SetWindowsHookEx() WM_KEYBOARD_LL not coming through with full screen RDC
问题描述
我正在尝试做诸如Skype之类的计时计时器风格的事情.如果用户离开"了一段时间,我将触发一些操作.我一直在将SetWindowsHookEx()与WM_KEYBOARD_LL一起使用,效果很好.直到您打开RDC连接并使其全屏显示.然后我再也没有键盘事件.
I'm trying to do a away timer style thing like Skype. If the user is 'away' for a period of time I'll trigger something. I have been using SetWindowsHookEx() with WM_KEYBOARD_LL which works fine. That is until you open a RDC connection and have it full screen. Then I never get the keyboard events.
有人碰到这个吗?还是知道实现此目标的更好方法?我实际上已经测试过Skype,并且使用全屏RDC,如果我键入RDC,它将正确地从离开"转到在线".
Anyone come across this? Or know of a better way to achieve this? I have actually tested skype and with a full screen RDC it will correctly go from Away to Online if I type in the RDC.
谢谢
在Raymond Chen的评论之后,我做了一些测试,他是对的.难以置信,经过我所有的搜索,我从未找到这种方法.它还解决了WPF应用程序无法触发LL_Mouse/KEYBOARD事件的问题.
After Raymond Chen's comment I did some testing, and he is right. Can not believe I never found this method after all my searching. It also solved an issue I was having with a WPF app not triggering the LL_Mouse/KEYBOARD events.
再次感谢.基于此更新我接受的答案.如果您需要执行LL_MOUSE/KWYBOARD,则另一个答案仍然不错.
Thanks Again. Update my accepted answer based on this. The other answer is still good if you need to do LL_MOUSE/KWYBOARD.
推荐答案
Have a look at GetLastInputInfo()
. Try calling that periodically.
这篇关于SetWindowsHookEx()WM_KEYBOARD_LL不与全屏RDC一起通过的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!