[java] screensaver in java

Started by
6 comments, last by CPeX 21 years, 3 months ago
I was wondering : is it possible to program a screensaver with java. It''s just that I have programmed some nice effects in java and it would be nice if I could use them as screensavers. BTW : I don''t know anything about screensavers ( what the difference is between screensavers and normal programs etc ..)
Advertisement
My understanding is that a screensaver is not really any different from a regular win32 program.

You can checkout the screensaver framework at msdn.microsoft.com (do a search). It will give you an idea on how you could convert your java program.

What you might end up doing is creating a screensaver executable that instantiates the JVM to load your java app.
Am I right when I say : making a screensaver is making an exe file and change *.exe in *.scr ???

Just as simple as that ??
quote:Original post by CPeX
I was wondering : is it possible to program a screensaver with java. It''s just that I have programmed some nice effects in java and it would be nice if I could use them as screensavers.

BTW : I don''t know anything about screensavers ( what the difference is between screensavers and normal programs etc ..)


I''d be impressed if it could be done only using Java because how screensavers work is pretty specific to Windows (which I''m assuming you''re using). However, there''s nothing to stop you writing a regular Win32 screensaver that starts up a Java application when it is active.
Yes, you could take an application, change the extension to .scr and make it a screen saver. There are some specific messages you should handle, but nothing bad happened the last time I ignored them .

So you could make a skeleton Win32 app, that calls WinExec or ShellExecute to start the JVM and run the app.
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
From Wotsit.org

"
SCR files are nothing more complex than .EXE files with the
extension SCR. Windows calls the .SCR file with two command-line
options:

/s to launch the screensaver
/c to configure the screensaver

For the windows control panel to recognise the screensaver, the program''s module description string must begin with SCRNSAVE: (in uppercase). So, if writing a Visual Basic screensaver, simply set the application title to something like "SCRNSAVE:Test Screensaver"

To create a new screen saver simply write a program that checks the
command-line option when starting and performs the appropriate
action. The display should use a full-screen window (usually with a
black background) and should end when any key is pressed or when the
mouse is moved.

When the program is compiled, rename the .EXE to .SCR and put it
into the Windows directory so it can be found by the screensaver
selection dialog in Windows."

#Old Steve, he said to Xerox "Boys, turn your heads and cough"
And when no-one was looking he ripped their interfaces off#
Three Dead Trolls in a Baggie on the truth behind MacOS 1

SketchSoft | SketchNews
www.aidanwalsh(.net)(.info)
There''s another important command line option:

/p some_number

This is used for the preview of the screen saver.
"some_number" is the handle of the parent window where you can display your preview.
<$1,000,000 signature goes here>
hmmm all the windows specific stuff is not my cup of thea.
(thats why I''m using java for everyting. I''m I wrong when I think that Swing is much easier than the windows specific stuff)

Can somenone give me the code for the most simple screensaver program that call the java vm (in c++ ~~?~~)

Or some larger screensaver code where I can cut and past ?

thanks

This topic is closed to new replies.

Advertisement