DelphiFAQ Home Search:

How to create a Windows screen saver with Delphi

 

comments6 comments. Current rating: 5 stars (1 votes). Leave comments and/ or rate it.

The following steps will create a Windows screensaver straight from a Delphi project.

  1. In the project file (*.dpr) add {$D SCRNSAVE } after the uses clause.

  2. On the main form, turn off the border and icon controls. In the activate method set the form left and top to 0, and set the Windowstate to wsMaximize.

  3. In the form create method, set the Application.OnMessage to a method that controls the deactivation of the screen saver. Set the Application.OnIdle method to whatever display method for the saver.

  4. In the form create method the command line should be tested for /c and /s. These are the command line parameters windows uses to define whether the screensaver should run or configure. (/c is for configuration)

  5. Compile the program, and rename the .exe to .scr. Move it to the windows directory, and it should show up in the control panel.


Comments:

2005-11-30, 06:19:37
anonymous from Ireland  
rating
2007-11-23, 07:05:43
jj from Netherlands  
j
2008-02-23, 15:33:45
anonymous  
Thank you very for your instructions.
I've used them to create my <a href=' http://www.softlake..t;freeware Fractal Screen Saver</a>.
2008-02-23, 15:35:02
anonymous  
Oh Sorry, the link is:
http://www.softlake..saver.htm

<a href=' http://www.softlake..gt;Fractal Screen Saver</a>.
2009-02-13, 16:08:26
anonymous from France  
Thanks.
A basic black screen saver seems to work

using Delphi 2007, I am not sure that the $D SCRNSAVE directive has any impact. If it was supposed to create a .scr file instead of a .exe it did not work for me

I guess that to configure the screen saver, you need to find a way.
I seem to remember that Windows would supply a -s or -S parameter when you try to setup/configure a screen saver
2009-12-28, 00:36:12
anonymous from Indonesia  
When we configure a screen saver, we do it from display properties at Screen Saver tab. there is a thumbnail of the screen at that tab, and when we choose a screen saver, the chosen one will be displayed at that thumbnail. what is the parameter sent to screen saver at that condition (is it S?), what command sent to screen saver when we click Setting button, and how to access the thumbnail so we can draw there?

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: