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 termination | No | If 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 logoff | 30 | Time 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 message | You 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. |
Centered | No | This option centers the message text horizontally in the logoff dialog. The default is to left-justify it. |
Caption text | seconds to logoff | This 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: |
---|---|---|
\b | backspace | |
\t | tab | |
\u xxxx | Unicode character, up to U+FFFF | \u03a3 → Σ |
\U xxxxxxxx | Unicode character, up to U+10FFFF | \U1f63a → 😺 |
\\ | backslash | |
Macro: | Expands to: | Example: |
%c | computer name | BOOMBOX |
%d | domain name | eng.yoyodyne.com |
%f | first word of user’s display name | Fred |
%l | last word of user’s display name | Smith |
%m | second word, if any, of user’s display name | |
%n | user’s display name | Fred Smith |
%t | WinExit timeout in seconds | 30 |
%u | username | fsmith |
%v | username with domain | ENG.YOYODYNE.COM\fsmith |
%z | screen saver timeout in seconds | 600 |
%D | current date, default local format | Wednesday, March 16, 2022 |
%H | current time, 24-hour with seconds | 11:47:02 |
%I | current date, ISO format | 2022-03-16 |
%T | current time, default local format | 11:47:02 AM |
%Z | screen saver timeout in minutes | 10 |
%% | 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 Quit | REG_DWORD | ✓ | 0 |
Timeout | REG_DWORD | ✓ | 30 |
Text | REG_SZ | ✓ | You are about to be logged out. |
Center Text | REG_DWORD | 0 | |
Caption Text | REG_SZ | seconds 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.2 | 2024-01-02 | Tweaks to the About dialog. |
1.0.1 | 2023-12-24 | Added a VerInfo structure. Updated the About dialog to display the program’s web address. Updated the program’s web address. |
1.0.0 | 2022-03-16 | Added 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.1 | 2021-06-20 | DateStamp.cpp renamed to DateStamp.h; added a Build.txt file to the source archive. No functional changes. |
0.98.0 | 2021-06-17 | removes 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.0 | 2021-04-28 | beta 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.