如果用户持续使用系统,则显示消息 [英] Show message if user continuously using system

查看:87
本文介绍了如果用户持续使用系统,则显示消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要显示警报窗口,如果用户连续30/60分钟使用系统,请问有人可以提出建议,我该如何继续?

我的想法是,想到使用系统空闲过程,但是,如果正在运行任何后台(外观)应用程序,系统将不会处于空闲状态.

我在想的是从最后的按键或鼠标中找到的.您有什么建议?

在此先感谢并感谢.

非常感谢,
Hari

Hi,

I have a requirement to show alert window, if user continuously using the system for 30/60 min, Can any one please suggest, how I can proceed?

Ideas I got are, thought of using system idle process but, system will not be idle if any background(outlook) applications are running.

What I am thinking is finding out of last key press or mouse.What do you suggest?

Appreciate and thanks in advance.

Many Thanks,
Hari

推荐答案

如果需要记录上次用户输入的时间(鼠标/键盘),则可以使用Windows挂钩.问题是:它不能仅使用C#来完成,因为根据Microsoft文档,设置全局挂钩应该是一个单独的非托管DLL. (如果只需要为当前应用程序进程设置挂钩,则可以在P#中使用P/Invoke在C#项目中完成,但这不是您的情况:您需要系统全局挂钩.)
请看我对这个问题的评论.我仍然想知道需求的动机.

—SA
If you need to record the time of last user input (mouse/keyboard), you can use Windows Hooks. The problem is: it cannot be do purely with C#, because, according Microsoft documentation, setting up a global hook should be done is a separate unmanaged DLL. (If you need to call set up a hook only for a current application process, you can do it in your C# project using P/Invoke, but this is not your case: you need a system-global hook.)

Please see my comment to the question. I still want to know the motivation of requirement.

—SA


这篇关于如果用户持续使用系统,则显示消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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