检测用户空闲(每个应用程序实例) [英] Detect user idle (per application instance)
问题描述
我需要我唯一的(每个我的应用程序实例)应用程序的用户空闲检测。
我不能使用的 GetLastInputInfo 的,因为是指定会话的用户输入
I need user idle detection in my application only (per "my application instance").
I can't use GetLastInputInfo because is session-specific user input:
GetLastInputInfo 不提供跨所有运行的会话系统范围的用户输入信息。相反,GetLastInputInfo提供的指定会话的用户输入信息只调用该函数的会话。
GetLastInputInfo does not provide system-wide user input information across all running sessions. Rather, GetLastInputInfo provides session-specific user input information for only the session that invoked the function.
有什么建议?
推荐答案
您可以使用<一个href="http://msdn.microsoft.com/en-us/library/system.windows.forms.application.addmessagefilter.aspx"相对=nofollow> Application.AddMessageFilter
和观看消息重新presenting用户交互(例如鼠标,键盘,也许菜单激活)。
You could use Application.AddMessageFilter
and watch for messages representing user interaction (e.g. mouse, keyboard, maybe menu activation).
这篇关于检测用户空闲(每个应用程序实例)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!