Solved

Converting EXE to SCR files

Posted on 2000-05-08
4
1,388 Views
Last Modified: 2008-02-01
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.
0
Comment
Question by:lacheur42
  • 2
4 Comments
 
LVL 12

Expert Comment

by:pjknibbs
ID: 2790179
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.
0
 
LVL 15

Expert Comment

by:simonet
ID: 2790184
>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

0
 
LVL 1

Author Comment

by:lacheur42
ID: 2798432
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.
0
 
LVL 15

Accepted Solution

by:
simonet earned 100 total points
ID: 2798507
>building those functions around an existing exe

That's only possible if you have the sources. The program needs to be recompiled.

>a program that would be capable of converting an exe to scr

No, there isn't, and, besides the technical difficulties such a program would face, you've said yourself there is a very small market for that.

>Does VisualBasic have those types of functions

There are wizards and frameworks you can use with VB that will easen the process of creating SCR files.

VB is not my main area (that would be Delphi), but here's a great site on writing screen savers (all tech info you may ever need or want):

http://www.wischik.com/scr/resources.html

Yours,

Alex
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now