Screensaver

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

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()

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.

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!

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.

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.

Okay. Problem solved. 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!

PS. I am not designing any serious screensaver so don’t worry - you aren’t going to see it. I promise. I just wanted a girl to have it.