的MS Access / VBA,检查桌面锁 [英] MS Access / VBA, check for desktop lock

查看:185
本文介绍了的MS Access / VBA,检查桌面锁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我试图找到一种方式的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.

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

<一个href="http://stackoverflow.com/questions/2589236/how-to-get-the-idle-time-in-windows-xp-using-vba">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.

这篇关于的MS Access / VBA,检查桌面锁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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