检查用户是否空闲并使用我的应用程序。 [英] Check if user is Idle and using my application.

查看:78
本文介绍了检查用户是否空闲并使用我的应用程序。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个具有登录屏幕的应用程序。当用户使用授权密码登录时,他登陆工作屏幕,现在我想做的是,1>如果用户没有在工作屏幕上执行任何操作(在mfc中查看),则应用程序应在指定的时间段后自动注销。 (如果用户在工作屏幕上不活动,我该如何检查)2>如果用户不活跃,我想再次登录屏幕。



我首先想到的是我应该关闭应用程序然后重新启动将带给用户的应用程序到登录屏幕,但如果我关闭应用程序,那么我希望能够重新启动应用程序。那么可能在这里可以解决我的要求。在此先感谢。

I have made an application which has log-in screen. When the user logs in with authorised password, he lands on the working screen, Now what i would like to do is, 1> If the user is not doing anything on the working screen(view in mfc) then the application should auto-log off after specified period of time. (SO HOW CAN I CHECK IF THE USER IS NOT ACTIVE ON THE WORKING SCREEN) 2> And if user is not active i want to go to login screen again.

What i first thought is i should close the application then relaunch the application that will take the user to the login screen, but if i close the application then i want be able to relaunch the application. So what probably can solve my requirement here. Thanks in advance.

推荐答案

看看 GetLastInputInfo函数 [ ^ ]。


你可以看看这个文章,用于自重启应用程序。这将有助于您关闭和重新打开应用程序的方法。
You may take a look into this Article for a Self-Restartable Application. That will may helps on your approach for closing and reopening the application .


这篇关于检查用户是否空闲并使用我的应用程序。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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