的MS Access / VBA,检查桌面锁桌面、MS、Access、VBA

2023-09-08 11:24:33 作者:转身、说再见

基本上,我试图找到一种方式的MS Access(2003年),以检测用户是否已经做了按Ctrl + Alt + Del键,并锁定他们的工作站。如果出现这种情况,我想打开的数据库关闭。目前,我有一个运行在检查活动后台隐藏的形式,但它是不可靠的。

Basically, what I'm trying to find is a way for MS Access (2003) to detect if the user has done a Ctrl+Alt+Del and locked their workstation. If that happens, I want the open database to shut down. Currently, I have a hidden form that runs in the background that checks for inactivity, but it's unreliable.

有没有办法做到这一点在VBA,或者我应该这样做的另一种方式(或两者)?

Is there a way to do this in VBA, or should I do this another way (or both)?

谢谢!

推荐答案

你不会找到一个可靠的方式来做到这一点从内部访问。

You're not going to find a reliable way to do that from within Access.

按Ctrl / ALT /德尔实际上并没有锁定计算机,它带来了登录对话框,所以你需要一个辅助检测,看看在该对话框中选择什么样的用户选择。 如果用户presses赢+ L,而不是按Ctrl / ALT /德尔? 在Win7的(和Vista?)的用户可以锁定计算机从开始菜单 - 通常是一个鼠标操作,而不是键盘 如果访问不具有焦点的时候把钥匙是pssed $ P $的应用程序,它没有知名度的作用。

您可能想追求更可靠的应用程序本身检测空闲时间的方法。你目前的做法?你坚持与2003,或者可能你有可能升级到2007/2010?

You might want to pursue more "reliable" methods of detecting idle time within the app itself. What is your current approach? Are you stuck with 2003, or could you possibly update to 2007/2010?

或许这些?

http://www.tek-tips.com/viewthread.cfm? QID = 933476

How使用VBA来获得空闲时间在Windows XP?

这些仍然基于定时器的,不是看在登录状态。泰克超提示code是VB,它可以适用于VBA,也可能没有。所谓链接是VBA,看起来类似pretty的,所以有可能的。

Those are still timer-based, not looking at login state. The tek-tips code is VB, which may be adaptable for VBA, or may not. The SO link is VBA, and looks pretty similar, so there's potential.