HW-Profile Screensaver V0.1

This is a basically a redirector for screensavers. 
The current Hardware profile will determine which screensaver to start and that can be easily changed in the settings.

I programmed this because I wanted to use DimSaver as Screensaver on my Toshiba Tecra S1 but only if it's docked, 
and a custom simple one named "SMPTE" (plain testpattern) if it's not docked.
This was a perfect opportunity for me to attempt a simple and small Win32 GUI. I'm quite satisfied on how well this worked out.

Windows 95 and NT4 is the minimum requirement, older versions predate the support for HW-Profiles.

The Files in this package:
main.c - The entire program
main.h - Contains the resource IDs and some other stuff from WATCOM
main.ico - An Icon made from other icons from SHELL32.DLL (Win98)
main.rc - Resource code in English
main_ger.rc - Resource code translated to German
hwp-save.wpj - Watcom project file
cleanup.reg - Registry file to remove the settings
bugs.txt - Information about known bugs
win16.txt - Possible method to implement name support for 16-bit Screensavers
COPYING - WTFPL license
ANSI_ENG - English ANSI build
ANSI_DEU - German ANSI build
UNIC_ENG - English Unicode build
UNIC_DEU - German Unicode build
*_*\install.bat - Installer batch file
*_*\remove.bat - Uninstaller batch file
*_*\hwp_save.tgt - Watcom target file
*_*\hwp_save.scr - Compiled executable


The ANSI version is recommended for Win9x and use the Unicode version for WinNT to avoid errors caused by foreign characters.


When you create a new target in Watcom:
You should write the name as either ANSI_???\hwp_save.exe or UNIC_???\hwp_save.exe
Add "copy hwp_save.exe hwp_save.scr" in Execute after. (Watcom can't generate an .SCR extension)
Add "-dUNICODE" in "C Compiler switches"; "4. Misc Switches"; "Other options" text field for a Unicode build.


On translating the resources:
You just translate almost everything except for Comments and LegalCopyright in VERSIONINFO.
It is possible to change positions and sizes in the dialog.
The last entry number 9:IDS_TRANSLATORNOTICE will be appended to the about message box if it contains more than 1 character.
That string is for your credits as translator, something like "Translated to French by FrenchDude95".


On last note about LFN (Long File Name):
Using that as name for the screensaver was introduced in Win9x but it has a very whacky way of handling capitalization.
That's why install.bat uses "Hw-Profile Screensaver",
because using "HW-Profile Screensaver.scr" will cause it to be displayed as "Hw-profile screensaver".



The Settings are saved in the registry:
HKEY_CURRENT_USER\Software\T. Sosnow.\HW-Profile Screensaver

There's plenty of write only values (for troubleshooting purposes), these values will not be READ by the program.
If a profile has an screensaver assigned then a subkey with the profile number will be created.
Also if the screensaver of an profile gets set to none then the subkey will be deleted.

The default value is a write-only REG_SZ and set to "Win9x" or "WinNT" depending on what has been detected.
NoLaunchErr is a REG_DWORD that will be set to 1 if "Suppress launch error" is enabled, otherwise it's 0

Within the subkeys of the profiles are 3 values of the type REG_SZ:
The default is a write-only value that's the name of the profile.
FileName is the path to the selected Screensaver which is the only value that matters.
FirstStr is a write-only value with the name of the Screensaver.
DO NOT CREATE ANY SUBKEYS WITHIN THE PFOFILE KEYS, this will prevent the program from deleting the subkey on WinNT systems.


T. Sosnow. <t-sosnow@posteo.com>
Visit QWERTZ-tek at http://qwertz.w10.site/ for my other stuff
August 21, 2025
