New Logoff Screen Saver

Version 1.0.2     2024-01-02

Charles Dye

Purpose:

This is a recreation of the old WinExit screen saver from the Windows 2003 Resource Kit. It’s a screen saver program. Like other screen savers, you set it up to run after a period of inactivity. Unlike most screen savers, though, it doesn’t display pretty graphics on the screen. This one just logs the current user out. It’s a handy tool for e.g. a computer lab or an internet cafe — any place where users tend to walk away from the machines without logging out properly.

So why reinvent Microsoft’s wheel? The 2003 WinExit screen saver is still useful, but it’s getting a bit long in the tooth. It's 32-bit only, so it needs to go in the SysWOW64 directory under 64-bit Windows. It tries to save its settings to Control.ini, an old-fashioned approach which makes installation tricky on modern versions of Windows. And its help file is in an obsolete format which Microsoft no longer supports. This rewrite saves its settings to the registry, and includes a .CHM help file. 64-bit and 32-bit builds are included; pick the one that’s right for your system. I’ve also added a few new options, plus some macros that you can use in the message text.

This is a complete, from-scratch rewrite. I do not have access to Microsoft’s source for WinExit. Any bugs are, therefore, mine.

Installation:

If you’re using 64-bit Windows, copy WinExit.scr and WinExit.chm into C:\Windows\System32.

If you’re using 32-bit Windows, copy WinExit-x86.scr and WinExit.chm into C:\Windows\System32.

Don’t know what flavor of Windows you are using? Look in the root directory of your C: drive. If you have both C:\Program Files and C:\Program Files (x86) folders, then you are using 64-bit Windows. If you only have one C:\Program Files folder, then you’re using the older 32-bit variety.


Once you have copied the files into C:\Windows\System32, WinExit will be available in the “Screen Saver” applet. You can select it and set a timeout value as usual. In a multiuser environment, you will probably want to create a policy to set it as the default (or mandatory?) screen saver for all users.

I recommend that you disable the “On resume, display logon screen” or “Password protect the screen saver” option. Enabling this option can force the user to log back in after he cancels the logoff dialog — which doesn’t make a whole lot of sense!

Configuration:

Once you have installed the screen saver in C:\Windows\System32, you can configure it using the “Screen Saver” applet. Depending on the version of Windows you’re running, you may find this applet in Control Panel; or in Settings / Personalization / Lock Screen, at the bottom of the page. Select “Logoff Screen Saver +” under Screen saver, and click the Settings… button.

These settings are available in the configuration dialog:

Setting:Default:Effect:
Force application terminationNoIf this option is off, the user will be prompted to save opened documents or to abort the logoff. If it’s on, he will not be given the opportunity to save files; he will just be forcibly evicted. Turning this option on increases the chance of losing data, but reduces the chance of the logoff process hanging indefinitely when no one is there to respond to the prompts.
Time to logoff30Time in seconds that the countdown dialog will be displayed. If it’s zero, logoff will begin immediately (you probably won’t even see the dialog). The maximum is 9999 seconds.
Logoff messageYou are about to be logged out.This message will be shown in the logoff dialog, above the countdown. The maximum length is 255 characters. There are a few character escapes and macros which you may include in the message.
CenteredNoThis option centers the message text horizontally in the logoff dialog. The default is to left-justify it.
Caption textseconds to logoffThis text will be displayed just below the countdown. The maximum length is 63 characters.

Character Escapes and Macros:

These may be used in the message string, which is displayed in the logoff countdown dialog.

Escape:Expands to:Example:
\bbackspace
\ttab
\uxxxxUnicode character, up to U+FFFF\u03a3 → Σ
\UxxxxxxxxUnicode character, up to U+10FFFF\U1f63a → 😺
\\backslash
 
Macro:Expands to:Example:
%ccomputer nameBOOMBOX
%ddomain nameeng.yoyodyne.com
%ffirst word of user’s display nameFred
%llast word of user’s display nameSmith
%msecond word, if any, of user’s display name
%nuser’s display nameFred Smith
%tWinExit timeout in seconds30
%uusernamefsmith
%vusername with domainENG.YOYODYNE.COM\fsmith
%zscreen saver timeout in seconds600
%Dcurrent date, default local formatWednesday, March 16, 2022
%Hcurrent time, 24-hour with seconds11:47:02
%Icurrent date, ISO format2022-03-16
%Tcurrent time, default local format11:47:02 AM
%Zscreen saver timeout in minutes10
%%percent sign 

Registry Use:

WinExit first attempts to read its settings from HKEY_CURRENT_USER\Software\WinExit.SS. If that fails, it will next try to read from HKEY_LOCAL_MACHINE\Software\WinExit.SS. If that also fails, it will use its internal defaults.

When you change the program’s settings with the configuration dialog, the new settings will be saved to HKEY_CURRENT_USER\Software\WinExit.SS.

Value Name:Type:Req:Default:
Force QuitREG_DWORD  ✓0
TimeoutREG_DWORD  ✓30
TextREG_SZ  ✓You are about to be logged out.
Center TextREG_DWORD0
Caption TextREG_SZseconds to logoff

When WinExit reads settings from a registry key, all the values marked with a ✓ must be present and valid. If any is missing or of the wrong type, then the entire key will be ignored. (Values without a ✓ are optional.)

Note that, while the program will try to read default settings from HKEY_LOCAL_MACHINE\Software\WinExit.SS, it will never write to that location. If you want to create default settings for all users, you must create and fill this registry key yourself, e.g. with a RegEdit script.

Changes:

Version:Date:Notes:
1.0.22024-01-02Tweaks to the About dialog.
1.0.12023-12-24Added a VerInfo structure. Updated the About dialog to display the program’s web address. Updated the program’s web address.
1.0.02022-03-16Added the ability to customize the countdown caption text. Added %m macro for user’s second name. Tweaked the handling of malformed character escape sequences.
0.98.12021-06-20DateStamp.cpp renamed to DateStamp.h; added a Build.txt file to the source archive. No functional changes.
0.98.02021-06-17removes the option to prevent the user from cancelling the countdown; attempts to disable the secure screen saver option; other minor tweaks and bug fixes
0.97.02021-04-28beta build, more-or-less feature complete

Credits:

The “exit door” icon is by Custom Icon Design. I downloaded it from IconArchive.

Status and Licensing:

This software is © Copyright 2024, Charles Dye. Unaltered copies of the binary and documentation files may be freely distributed without restriction. I make no guarantee and give no warranty for its operation.

Download:

You can download the current version of the program from http://charlesdye.net/dl/winexit.zip.

You can get my source code from http://charlesdye.net/dl/src/winexitsrc.zip.