Link to home
Start Free TrialLog in
Avatar of lacheur42
lacheur42

asked on

Converting EXE to SCR files

Does anyone know a way to convert an exe file into an scr file for win98?  What the exe does is flips to 320x200 256, then does some graphics stuff.  My guess is that it's not possible, that scr's have to be coded specially, but I could be wrong.  Points awarded for a solution or a good reason why not.
Avatar of pjknibbs
pjknibbs

Although SCR files are normal Windows executables, they do need to do certain things a normal EXE might not--for instance, they have to quit as soon as the user moves the mouse or hits a key, and they need to come up with something meaningful when the user hits Settings... in the screen saver setup dialog. (This is done by calling the SCR file with a /s switch). Unless your EXE file does these things it won't make a very good screensaver--most people would get very annoyed with a saver which could only be quit using Alt+F4, for instance.
Avatar of simonet
>a good reason why not.

Here are the reasons why EXEs cannot be converted to SCR:

A SCR, which is in fact an EXE, is a screen saver because it exports 2 special functions:

ScreenSaverProc
and
ScreenSaverConfigureDialog

The EXE, in order to be a SCR as well, must have these 2 functions, and they must comply to the Win32 SDK. They must be able to receive the correct number and types of parameters that are passed to it at different moments.

For example, when the screen saver is to show a small demo on the small monitor in the Display Control Panel applet, a specific parameter is passed to the SCR's ScreenSaverProc function.

The EXE must also export a string resource of type "DESCRIPTION", which is the name of the screen saver.

Making it short, the EXE must comply to these general guidelines in order to "deserve" the SCR extension.

If you take an EXE and change its extension to SCR, what can happen is:
- Windows may not find the "DESCRIPTION" resource and will display the file name instead of the screen saver name
- Windows will not find the call back procedures (forementioned), and the screen saver will not work.

I hope this has shed some light on why it's not possible to simply rename the EXE to SCR in order to make it a screen saver app. If you have more questions regarding this, just let me know.

Yours,

Alex

Avatar of lacheur42

ASKER

I'll accept your answer, but first I'd like to know if you know of an program that would be capable of building those functions around an existing exe, (or if that would be possible).  Basically, a program that would be capable of converting an exe to scr.  I'm not particularly hopeful, since it seems that the market would be pretty small, but hey, thought I'd ask.  I'm curious as to how one actually get written.  Does VisualBasic have those types of functions built into it?  I'm just writing these things in Qbasic, and I have no idea about how windows really functions.
ASKER CERTIFIED SOLUTION
Avatar of simonet
simonet
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial