Solved

System idle time

Posted on 2000-04-21
10
380 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

685 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