GetLastInputInfo不正确工作? [英] GetLastInputInfo does not correctly work?

查看:339
本文介绍了GetLastInputInfo不正确工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用GetLastInputInfo来检查鼠标和键盘的最后输入信息。
在我的电脑上的系统正常工作,但当我在我的笔记本电脑上运行我的程序不工作。
我看到LASTINPUTINFO每10-15秒更换一次。

I used GetLastInputInfo for check last input info from mouse and keyboard. On my system on PC is working correctly, but when I run my program on my laptop it does not working. I see that LASTINPUTINFO changing every 10-15 sec.

现在,我编写示例程序来检查鼠标和键盘的所有输入,并保存最后一次输入时间

Now, I am writing example program for check all input from mouse and keyboard and save last input time from this device but this time not changing if I idle.

如何检查谁是生成活动(设备/程序)和更改struct LASTINPUTINFO?

How can I check who is generate Activity (device/program) and change struct LASTINPUTINFO?

推荐答案

您可以使用原始输入,以查看活动是否来自实际的鼠标/键盘本身。如果是,您可能有一个错误的设备驱动程序或正在运行某种内部计时器以生成稳定的输入事件流的驱动程序。

You can use Raw Input to see if the activity is coming from the actual mouse/keyboard itself. If it is, you might have a faulty device driver, or a driver that is running some kind of internal timer to generate a steady flow of input events.

如果 GetLastInputInfo()更新没有报告Raw活动,而正在运行的应用很可能使用输入注入API,例如 mouse_event() keybd_event() SendInput() 。你必须直接挂钩,找出哪个应用程式正在呼叫他们。

If GetLastInputInfo() updates without Raw activity being reported, than a running app is most likely using an input injection API like mouse_event(), keybd_event(), or SendInput(). You would have to hook those directly to find out which app is calling them.

这篇关于GetLastInputInfo不正确工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆