Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How to create a 3D Screensaver

Author
Message
Scarecrow
21
Years of Service
User Offline
Joined: 12th May 2003
Location:
Posted: 12th May 2003 15:39
I see that amongst DBPro's features is the ability to create 3D screensavers. I downloaded the trial version and read through the helpfiles and could see nothing about this.

How do I make my program into a 3D screensaver? Is it possible with the trial version of DBPro?

Is it possible with Dark Basic?

Crow
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 12th May 2003 17:32
when you go to make an exe file out of your program save your program as (name).scr instead of .exe...then save it in or move it to the C:\Windows\System folder...then just go to the control pannel on your computer then go to display then screen saver then just select your program out of the list of available screen savers...it will act more or less like a normal screen saver exept you have to press escape to end it...(unless you tell it otherwords in your program)...i hope this helps

Anyone Can Destroy...But Few Can Create...
Scarecrow
21
Years of Service
User Offline
Joined: 12th May 2003
Location:
Posted: 12th May 2003 17:44
So I basically rename my final EXE file extension to SCR?

Well, that works but it's very crude. I'd prefer it if there were DB options to make genuine screensavers with settings and such.
The screensaver also starts up as soon as I select it rather than waiting for me to click 'preview'

Nevermind.

Thanks for your help.

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 12th May 2003 19:06
You need to parse the command line parameters (I think it is cl$) and act accordingly.

/s Show the Screen Saver
/c Display the Settings Dialog
/a Display the Password Change Dialog
/p Preview the Screen Saver

At work at moment so can't test

Gronda, Gronda
Scarecrow
21
Years of Service
User Offline
Joined: 12th May 2003
Location:
Posted: 12th May 2003 19:09
Sonic,

Interesting. If you have time, could you elaborate, as I don't understand what any of that means.

Many thanks

Crow

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 12th May 2003 19:16
Basically, when you do a 'preview' it runs youe exe with a /p comand line argument. You can test for this and do something different from normal running (/s). Same with /c which you could test for and do a configuration screen and store stuff in a file or registry. For example setting how many stars in a starry screensaver.

Gronda, Gronda
Scarecrow
21
Years of Service
User Offline
Joined: 12th May 2003
Location:
Posted: 12th May 2003 19:51
Okay, I think I understand that. Where would I put the command line arguments? They are usually used when running a program from DOS or using a windows shortcut, right? There isn't anywhere to put them if you're using the compiled DB exe file as a SCR file.

Or can the arguments be placed in the DB program itself?

If so, then how?
If not, then what?

Crow

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 12th May 2003 22:36
command line arguments are automatically added by windows from within the screensaver control panel!

example:



Gronda, Gronda
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 12th May 2003 22:38 Edited at: 12th May 2003 22:39
The next trick is to test for /p which also gives you the window handle of the little screensaver preview window and put something there! I'll have a go at that later!

Gronda, Gronda
Scarecrow
21
Years of Service
User Offline
Joined: 12th May 2003
Location:
Posted: 13th May 2003 12:20
Sonic,

Thanks for taking the time to look into this.
So let me see if I understand this. By adding in this:

left$(cl$(),2)="/c"

Windows automatically adds in the option to bring up the screensaver settings when you click the 'settings' button in the screensaver section in the Display Properties?

Yes?

Crow

Scarecrow
21
Years of Service
User Offline
Joined: 12th May 2003
Location:
Posted: 13th May 2003 12:32
Okay, I've done a test build and I see that it does indeed add that option. Excellent. Thank you.

The trouble is, I don't understand how or why that works. I understand all of the code you posted except these two lines:

if cl$()="" or left$(cl$(),2)="/s"

if left$(cl$(),2)="/c"

Would you be kind enough to break it down for me and explain it, please?

Crow

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 13th May 2003 13:56
What I am saying is that the program has to handle the parameters that windows sends to ALL screensaver files. As screensaver files are usually just one .scr file, it has to determine what 'mode' to run in.

Normal mode is when file is just run after 30 minutes or whatever and windows runs this as whatever.scr /s

When you go into screensaver tab, windows automatically runs program with a /p for preview mode. As DBPro cant update the little preview window easily, it is best just to make program quit if it detects a /p

When you click on configure, it runs program with a /c . You can then have an options screen for selecting sound on/off, number of objects, e.t.c.

when you run a dbpro program with arguements, e.g. whatever.scr /p

you can see what parameters are passed with the cl$() command. look it up in manual for full description if you want.

All the left$(cl$(),2) command does is to see what the first two characters of the augument is. This is done because the /p option is sent with some extra stuff that you can use.

Hope that makes sense.

Gronda, Gronda
Scarecrow
21
Years of Service
User Offline
Joined: 12th May 2003
Location:
Posted: 13th May 2003 14:00 Edited at: 13th May 2003 14:11
It does. It makes a LOT of sense.
CL$ was the bit I was missing. I've not come across it before.

Thank you very much!

Crow

PS - I'll probably be back

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 13th May 2003 16:02
"I'll probably be back"

That would be an indecisive Arnie then!

Gronda, Gronda

Login to post a reply

Server time is: 2024-09-20 07:36:49
Your offset time is: 2024-09-20 07:36:49