Solved

System idle time

Posted on 2000-04-21
10
362 Views
Last Modified: 2008-03-17
I'm developing the security side of VB package, and I want to prompt the user to enter a password if the system has been idle for a set time. I dont want to raise an event for the the MDI, for every mouse move & keypress on every dll, and then check this against a permanently running timer. I can't use NT's security system either as the software will be running mechanical tests on aircraft for anything up to 3 months. Is there an API function which would do this?..(surely that's how screensavers are activated!) The security system can't rely on a screensaver application as this could easily be changed and modified by operators. Can anyone please help?
0
Comment
Question by:PeterDobson
10 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2738771
just posting to see if someone comes up with good solution  =)
0
 
LVL 3

Expert Comment

by:y2kwacko
ID: 2739150
A timer thread would not be appropriate for your solution?
0
 
LVL 1

Expert Comment

by:Ask_ED
ID: 2739354
Hi Peter,

My first thought is ... what password? the computer, the network/domain, your app's or another ??

My second thought is why don't you create a screensaver app since it sounds like you'll be in "conflict" with any user set screensave any way.

Try this for a couple of different examples: http://www.codehound.com/VB/Results/results.asp?Q=screensaver

Hope this helps... alittle
ED
0
 
LVL 5

Expert Comment

by:KDivad
ID: 2739442
I agree with ask_ed, write a screensaver and let windows execute it at the proper time.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2739992
that was going to be my suggestion if no one knew a "true" way of monitoring system time.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 5

Expert Comment

by:KDivad
ID: 2741246
A different method (still "cheating") would be to use GetAsyncKeyState and GetCursorPos in a loop or timer. You could quite easily determine if any keys are pressed or if the mouse is moved. Don't know if it's accurate enough, though.
0
 
LVL 1

Author Comment

by:PeterDobson
ID: 2751263
Edited text of question.
0
 
LVL 5

Expert Comment

by:KDivad
ID: 2753207
<<?..(surely that's how screensavers are activated!)>>
Screensavers are activated  (by windows) by sending a command to the system menu of the active app. I think it was SC_SCREENSAVER but I won't swear to that. The last time I tried it, though, it triggered a timer to send my system into "sleep" mode instead of activating the screen saver. With a system-wide hook (one that I think VB can't make because it needs to be in a standard dll) you could catch and discard the message and trigger your app instead.
0
 
LVL 5

Accepted Solution

by:
KDivad earned 70 total points
ID: 2753221
Another thought: Write your own shell that only gives access to the needed apps on the system. Now you can set your screen saver to whatever you want it to be. Replace command.com with an app of your own that starts windows and the user will be (possibly) unable to boot to DOS to replace the shell. The new shell (yours) can use the foldernotify APIs to watch for changes to the system.ini (win.ini?) file and check/replace the SCRNSAVE line back to your own password app. All in all, you really only need two new apps and you've got much greater control.
0
 
LVL 5

Expert Comment

by:KDivad
ID: 2754658
{startled} I wasn't expecting any points for that, but thanks!
I've fooled around with some of these ideas, so let me know if you have any questions and I'll try to help.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now