Solved

Converting EXE to SCR files

Posted on 2000-05-08
4
1,392 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

830 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