VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Global Idle Check 1.0

Jan Botha  (6 Submissions)   Windows System Services   Visual Basic 3.0   Advanced   Wed 3rd February 2021

Global Idle Check is used to monitor your system for activity. If found that your system has been inactive (idling) for the amount of time you specify, the code will call the IdleStateEngaged sub, which is where you can put your code.
The code demonstrates the use of the GetAsyncKeyState as well as the GetCursorPos API's.
The code continually monitors the state of your keyboard and mouse buttons, as well as you mouse position.
This submission is commented quite heavily, and I hope it is easy to follow. Please vote for me if you think I deserve it. Give me comments as well, please.
If you've always wanted to create a screen saver that is independent of windows, you can do so now.

Inputs
INTERVAL - set the number of seconds the system must be inactive before the idle-state is reached.

Assumes
BEFORE you start: Put 2 Timers on a form. Name the one tmrPeriod and the other tmrStateMonitor. Set both Timers' Interval property to 1.

Side Effects
This will screw up if you run it at midnight, because the Timer object resets to 0 then.

API Declarations
'I've put them in the code itself!

Rate Global Idle Check 1.0 (12(12 Vote))
Global Idle Check 1.0.bas

Global Idle Check 1.0 Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters