[casual_games] Creating custom screensavers

Brian Tegart brian at tegarttech.com
Thu Mar 5 18:40:04 EST 2009


Hi Jonah,

I have written a few screen savers, and even successfully sold one as
shareware.

As you mentioned, normally screen savers go in c:\windows\system32 or
c:\windows (don't hard-code those paths, use the %SystemRoot% variable to
determine where the root Windows folder is because Windows might be
installed somewhere else). However, you can put them anywhere you want, with
a two caveats:
- First, you have to change a registry setting: Change the
"HKEY_CURRENT_USER\Control Panel\Desktop\SCRNSAVE.EXE" value's data. For
example, it might be "C:\WINDOWS\system32\ssstars.scr" for the star field
saver. You can change that to wherever your saver lives. However, changing
this registry setting might require Admin privileges anyway, so that may not
help much.
- Second, when a user goes into their display settings, and then the
screen saver tab, the savers it lists in the drop down menu are all the .scr
files that the system can find in %SystemRoot%, %SystemRoot%\system32, plus
the entry from the registry key above if it's not in the two %SystemRoot%
locations. The problem if your screen saver lives elsewhere: once the user
changes from your screen saver to another one, the registry key is updated
to the selected saver and your saver will thus never show up in the list
again, i.e. the user can never switch back to your saver (at least not
without your app resetting the registry key or something).

Given those two facts, it's really just better to install it where savers
normally go. If you have a formal installer for your app (which should be
installed to %ProgramFiles%), that's when the saver should be installed as
well (to %SystemRoot%\system32) for your installer will be able to write to
Admin-protected areas anyway for the main app (I can provide some
information about this as well, if you need it).

A couple other things to be aware of:
- screen savers should have the .scr extension (so the Display settings can
find them and add them to the list). They are really just .exes though.
- your saver should (but doesn't have to) support the following command-line
parameters, which will be passed to you by Windows:
/c (or -c) or nothing = start the screen saver in "Configure" mode. In
other words, display the dialog box to let the user change settings, etc.
/s (or -s) = start the screen saver in normal "Start" mode (i.e. running
full screen)
/p (or /l or -p or -l) = start the screen saver in "Preview" mode,
meaning running normally but not in full screen, but rather in the preview
window of the Desktop Settings dialog you open when you want to
change/configure screen savers. In addition to the /p argument, Windows will
also give you the window handle of the window to draw in as the second
argument. If you don't support this parameter, the preview window will just
remain black.
/a (or -a) = Obsolete. Used on Win95/98 to tell your saver to put up UI
to let the user change the screen saver password. More recent versions of
Windows handle locking passwords for you.

Let me know if you have questions.

Brian Tegart
http://www.tegarttech.com


-----Original Message-----
From: casual_games-bounces at igda.org [mailto:casual_games-bounces at igda.org]
On Behalf Of Jonah Cohen
Sent: Thursday, March 05, 2009 1:23 PM
To: casual_games at igda.org
Subject: [casual_games] Creating custom screensavers

Does anyone know of any good resources that explain how to create
custom screensavers for games? For example, the way Fishdom lets you
choose any one of your fish tanks to be your screensaver. I'm not
having any trouble getting my game to launch in "screensaver mode",
where it just goes to an idle screen until the mouse moves, but I'm
not sure how to actually install the screensaver in Windows (without
copying it to c:\windows\system32, which in Vista requires
administrator privilege), and I also haven't found much useful info on
handling the preview window and settings box and accommodating
passwords and so forth. For what it's worth, I'm using a DirectX 9
derivative of the PopCap framework if that's at all relevant.

Jonah Cohen
_______________________________________________
Casual_Games mailing list
Casual_Games at igda.org
http://www.igda.org/casual-subscribe
Archive: http://www.igda.org/casual-subscribe
Archive Search:
http://www.google.com/coop/cse?cx=010373383720242846960%3Az3tdwggxil8
List FAQ:
http://www.igda.org/wiki/index.php/Casual_Games_SIG/Casual_Games_List_FAQ

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.237 / Virus Database: 270.11.8/1985 - Release Date: 03/05/09
07:54:00



More information about the Casual_Games mailing list