编程重置Windows XP的空闲时间 [英] Programmatically reset Windows XP IDLE time

查看:161
本文介绍了编程重置Windows XP的空闲时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

视窗每用户触摸键盘或鼠标时重置空闲时间。我的应用程序需要重新在特定时刻的空闲时间,但我无法弄清楚如何以编程方式做到这一点。



下面用VB不会重置空闲时间,C#或QT4结果
- 编程鼠标移动/点击结果
- 编程按键结果
不知何故的Windows知道这些行为是模拟结果

我怎么能重置空闲时间?任何想法将不胜感激!


解决方案

使用的 SetThreadExecutionState()。该ES_SYSTEM_REQUIRED选项(2)重置系统空闲计时器。访问pinvoke.net为所需的声明。


Windows resets the IDLE time every time the user touches the keyboard or the mouse. My application needs to reset the IDLE time at specific moments, but i can't figure out how to do this programmatically.

The following does NOT reset the IDLE time using VB, C# or QT4.
- Programmatic mouse movement / click.
- Programmatic keystroke.
Somehow Windows knows these actions are simulated.

How can i reset the IDLE time? Any thoughts will be greatly appreciated!

解决方案

Use SetThreadExecutionState(). The ES_SYSTEM_REQUIRED option (2) resets the system idle timer. Visit pinvoke.net for the required declarations.

这篇关于编程重置Windows XP的空闲时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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