如何获得系统空闲时间? [英] How to get the system idle time ?

查看:74
本文介绍了如何获得系统空闲时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在开发Windows应用程序,为此,我想查找系统是否在过去的10分钟内处于空闲状态,否则,我想找出系统的空闲时间,因此任何人都可以帮助我.
谢谢.

Hi everybody,
I am developing windows application, for that i want to find whether the system is idle for last 10 minutes or not, oderwise i want find out the system idle time, so anyone please help me.
Thanking you.

推荐答案

您将不得不在User32.dll中使用GetLastInputInfo方法.
You will have to use GetLastInputInfo method in User32.dll. That should help.


有一篇文章此处 [ ^ ]解释了如何执行此操作,并提供了一些方法示例代码.

它使用d @ nish已经提到的GetLastInputInfo API调用.
There is an article here[^] that explains how to do it, and has some sample code.

It uses the GetLastInputInfo API call that d@nish has already mentioned.


这篇关于如何获得系统空闲时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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