Solved

Converting EXE to SCR files

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to split this in C++ 4 93
bunnyEars challenge 6 99
C Programming - If Statement 8 72
C# DataGridView_RowsAdded event not firing 1 64
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

914 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

17 Experts available now in Live!

Get 1:1 Help Now