How Screensavers Work

By: Jeff Tyson

Step by Step

We will go through the process of how a screensaver works based on a Windows 95/98 computer. Although the system commands and exact details may differ, the process is essentially the same for other computers as well.

Your computer constantly monitors the activity going on between the various components of the system. When it notes that the keyboard and mouse have been idle for the amount of time indicated in the screensaver settings of the Display properties window, the system sends a special command to the foreground (current) application to see if it can launch the screensaver. If an application is running that has a Computer Based Training (CBT) window open, or has a non-Windows program, such as one run from the MS-DOS prompt, as the foreground application, Windows will not start the screensaver.


Here's exactly what it does:

  1. To find out whether it can start the screensaver or not, Windows sends a message to the foreground application. This command is asking the application, "Can I start the screensaver?" A non-Windows program will not understand the command, and therefore will not answer it. A CBT application will understand it, but will respond with a command that means "No, I'm providing training right now." All other applications should respond positively to the command.
  2. Windows then looks at the line SCRNSAVE.EXE=____ in the system.ini file to see if a screensaver has been specified. If the entry is blank, it ignores the command to execute the screensaver. But if a filename is listed, it attempts to load that file. As long as the file listed is an actual screensaver, the program executes and creates the screensaver images on top of the current desktop.
  3. The screensaver continues to run until Windows detects input from the keyboard or mouse. With most screensavers, moving the mouse or pressing any key will immediately terminate the screensaver. But screensavers can be programmed to stop when only certain keys or buttons are pressed, or when the mouse is moved a certain distance. This feature is especially useful in interactive screensavers.
  4. When Windows gets input that it should terminate the screensaver, it checks to see if password protection is turned on. If it is, a box pops up requiring that you enter a user name and password. Otherwise, the screensaver simply terminates. When password protection is active, failure to supply the correct name and password will cause Windows to continue to run the screensaver program. While this provides some security, it is important to note that Windows 95/98 screensavers create their own password dialog boxes, and request the password and user information from the system. If you are not certain of the reliability of the source of the screensaver, be careful about using password protection. Hackers can and do create screensavers that use this weak point in system security to capture passwords. This is not an issue with systems running Windows NT, which only allows screensavers to call up the system password dialog box -- they can not create their own.

In the next section, you'll find out how to set up your own screensaver.