Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

System idle time

Posted on 2000-04-21
10
Medium Priority
?
397 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
[X]
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
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
Technology Partners: 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 140 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

722 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