PDA

View Full Version : Screensaver



Orzech
09-13-2003, 02:38 AM
Hello!

I have a few questions about making screensavers. I used to just change the extension of an application to scr but I recently I've encounterd some problems. It always seemed to work but lately I made a OpenGL demo an I wanted to set it to be a screensaver (BTW: Win98). The program works just fine but when I set it to be a screensaver some fatal error occurs when it starts. Why? If I run it like all other programs it works. Are there any restrictions for doing screensavers? I know it isn't much of an OpenGL related topic but I'll be very thankful for your advice. It seems that the program fails before starting any OpenGL stuff but I can be wrong. Meaby there is something special in creating window in screensavers?

Thanks in advance!

Orzech

Simi
09-13-2003, 05:19 AM
Under Windows, you have to provide at least 3 functions, so that the screen saver can be listen in the control panel. The header for the screen saver framework is ScrnSave.h.

The three required functions are:

1) ScreenSaverProc()
2) ScreenSaverConfigureDialog()
3) RegisterDialogClasses()

09-13-2003, 05:20 AM
Screensavers are different than .exes. There are entry points that have to be provided by special names, and other constructs.

If you want password protected screensaver support, the differences increase between win98 and NT based systems.

Search the Microsoft knowledgebase for an article on writing screensavers to get started.

Orzech
09-14-2003, 01:46 AM
Hey! I made some screensavers just by changing exe to scr and they work. I copied them to windows\system\ directory and I could use them. There wasn't any special named procedures. Do you think that's the real problem why the program fails?

Thanks for your help! http://www.opengl.org/discussion_boards/ubb/smile.gif

Simi
09-14-2003, 03:18 AM
I don't know if that will solve your problem, but you asked for 'restrictions' and the scr lib exists for a reason. Try it and ask again if it still doesn't work.

Deiussum
09-15-2003, 04:20 AM
The screensaver library is very helpful in creating screensavers, but it's possible to just rename an exe to an scr as well. If you do that, however, you need to be sure you handle all the command line parameters such as /s or /screen for starting the screensaver. Also make sure you have a configuration dialog, which I believe is what should come up by default if no command-line parameters are specified.

Orzech
09-15-2003, 10:32 AM
Okay. Problem solved. http://www.opengl.org/discussion_boards/ubb/smile.gif I tried to use this screensaver library but at the end it didn't work like I wanted to. It runned correctly form compiler but it wasn't really working as a screensaver. Nevermind. What I did was that I came back to my old method and I figured out that the problem was something totally different. It was a fault of invalid paths. I guess that program couldn't create a log file so it failed all the time.

Anyway,

Thanks for your help! http://www.opengl.org/discussion_boards/ubb/smile.gif

PS. I am not designing any serious screensaver so don't worry - you aren't going to see it. I promise. http://www.opengl.org/discussion_boards/ubb/smile.gif I just wanted a girl to have it.