Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

System idle time

Posted on 2000-04-21
10
377 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

808 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