Originally published on: Tue, 20 Oct 2009 00:54:54 +0000
Some time ago, I wanted to see if the simulated mouse moves generated via calls to the WIN32 API mouse_event function would prevent the screen-saver from triggering.
In the current version of XP ( and some older versions of Windows ) these events do indeed keep the screen-saver from activating.
Please refer to the source below.
busy_mouse.c
When you run busy_mouse.exe the program will loop indefinitely. The program checks the CAPS LOCK state. If CAPS LOCK is enabled, it will then move the mouse in a rectangular pattern via mouse_event().
When CAPS LOCK is off, the simulated mouse events halt.
I've used this to keep the screen visible so that I can watch for emails or processes that run long while I'm away from the mouse and keyboard.
The source and executable file for busy_mouse can be downloaded in a single archive at: http://www.mailsend-online.com/wp/busy_mouse.zip
Unless otherwise noted, all code and text entries are Copyright ©2009 by James K. Lawless
Save to del.icio.us
Save to StumbleUpon
Digg it
Save to Reddit
Share on Facebook
Share on Twitter
More bookmarks
| Previous post: | Thwarting HTTP Referer Trackbacks |
|---|---|
| Next post: | A TCP Command Line Interface in Rhino JavaScript |
Subscribe!
Auto Save Clipboard Images Redux
Extending SpiderMonkey JavaScript on Windows
Rhino JavaScript to EXE with launch4j
Compiling Rhino JavaScript to Java
Directory Traversal in Rhino JavaScript
A Command-Line MP3 Player for Windows
Auto Save Images from the Clipboard
Java in a Windows EXE with launch4j
An Interview with Tom Zimmer: Forth System Developer
Setting Windows Console Text Colors in C
A Simple Media Control Interface Script Processor
Hiding Batch File Console Windows
Auto Save Images from the Clipboard
A Lightweight Alternative to Windows Shortcuts
A Simple Associative Array Library in C
MicroISV on a Shoestring
DadHacker
The Bottom Feeder
Writin' That Code!
The Recursive ISV
The Thomsen Blog
Prototypically Speaking
The Reinvigorated Programmer