Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 402
  • Last Modified:

System idle time

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
PeterDobson
Asked:
PeterDobson
1 Solution
 
AzraSoundCommented:
just posting to see if someone comes up with good solution  =)
0
 
y2kwackoCommented:
A timer thread would not be appropriate for your solution?
0
 
Ask_EDCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
KDivadCommented:
I agree with ask_ed, write a screensaver and let windows execute it at the proper time.
0
 
AzraSoundCommented:
that was going to be my suggestion if no one knew a "true" way of monitoring system time.
0
 
KDivadCommented:
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
 
PeterDobsonAuthor Commented:
Edited text of question.
0
 
KDivadCommented:
<<?..(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
 
KDivadCommented:
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
 
KDivadCommented:
{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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now