Screen Saver Toggle 2.0 (MS Windows XP, Windows 7, possibly others)
Donation-optional Freeware
Copyright (C) 2011
Programmer: J. Craig Gilbert, AKA slowmaker
http://rambling-nerd.wikispaces.com
2011 Feb

See license.txt for license details.

Screen Saver Toggle is a simple, portable utility with one purpose:
turning the currently active screensaver off (or back on)
with a minimum of fuss. I found the first version very handy for
quickly blocking the screensaver before burning CDs, running
Defrag, etc. Nowadays I use it more often to block the screensaver
before watching Netflix and the like.

The program puts a star field icon in your system tray.
Left-click the icon to deactivate the current screensaver;
the icon will change to a star field crossed out with a red
'X'. Left-click the icon again to reactivate the current
screensaver, turning the red 'X' off. 

Note that turning the red 'X' off does not actually *run* 
the screensaver; it simply removes the 'blocking' state
so the currently selected screensaver can run normally again
when the time comes.

Screen Saver Toggle has gained some new features since the first
release:

	-a third icon state, a question mark on yellow background.
	This icon is displayed when there is no screen saver selected,
	i.e. nothing available to block or unblock.
	-you can now run the screensaver from sstoggle2's system tray
	icon menu (right click to pop the menu up).
	-previous instance detection; sstoggle2 will not run if it
	detects its process already in memory (even one run from a
	copy saved elsewhere).
	-command line arguments:
	    sstoggle2.exe force
	        *runs the screensaver immediately, if it is not currently
	        blocked
	    sstoggle2.exe toggle
	        *toggles blocked/unblocked state of screensaver
	    sstoggle2.exe exit
	        *shuts down sstoggle2

		Note that these work even if a copy of sstoggle2 is already
		running. That is actually their intended use; to send signals
		to the currently running copy so users can set up more flexible
		control.
		
		For instance, an AutoHotkey user might add this line to one of
		their scripts:
		
		#s::run "z:\utils\sstoggle2.exe" "toggle"
		
		This would toggle the current screensaver state, if possible,
		whenever the Winkey and the 's' key are pressed.
		
Screen Saver Toggle does not save any of its settings to your registry,
though it does toggle a registry flag that blocks/unblocks the screensaver
in XP. However, sstoggle2 saves the state of your screensaver when it
starts, and will restore that original blocked/unblocked state when it
exits. So if you forget to toggle your screen saver back on, the next
reboot will set things right.

That's all, folks.

History
-------
January, 2011:  Finally putting out a second release.
				Updated contact info header, ported to FreeBasic.
				Changed the way sstoggle goes about its business,
				thanks to a bug in Windows 7 which prevents
				simple detection of the current screensaver activation
				state. As a result, a whole new family of bugs got in
				and had to be quashed.
				On the other hand, the new way of interacting with
				the screensaver state allowed me to do away with
				some things that were XP-specific, so it's possible
				sstoggle may be compatible with Win98 again. You
				tell me.

				Found and fixed a bug that had been lurking undetected since
				version 1: if you type WinKey+B to get keyboard access to
				the system tray, then activate sstoggle in circumstances that
				bring up a message box, you get an endless series of new
				message boxes as you try to dismiss them with the Enter key
				(no problems if using the mouse).

				Added prior instance detection and command line switches
				'force', 'toggle', and 'exit'.
				
November, 2008: Finally returned to this project for a few
tweaks plus a bug fix. Never officially released, this beta was only given
to one user.
    bug fix: switching to another user log-in and back would
             remove the blocking, but leave the red 'X' showing;
             this has been fixed so the blocking remains,
             as it should.

    tweak: added question mark icon for 'no screen saver' state
    tweak: added capability to run the screen saver instantly
           via tray icon right-click menu item

Early Novemberish, 2002: got pissed off at the fact that all the
screen saver blocking utilities I could find seemed to completely
miss the point of *convenience*, each one requiring just as many
clicks as going to Display Properties and turning the damned thing
off the normal way, so I wrote one that suited my personal laziness
level.--craig