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.

DarkBASIC Professional Discussion / Screensavers in Windows

Author
Message
Mr Snuggles
20
Years of Service
User Offline
Joined: 7th Dec 2004
Location:
Posted: 7th Dec 2004 08:33
I have a couple programs I've written that I'd like to use as screensavers, and I want to have them function like Windows screensavers ie working settings box like the default windows screensavers. Can this be accomplished with DarkBASIC? If not, are there any DLLs that can be imported or something? Any help on how to make professional functioning screensavers would be greatly appreciated

ooo isn't that precious
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 7th Dec 2004 08:58 Edited at: 7th Dec 2004 08:59
You can create proper windows in darkbasic without any Tpc's.
Here is a list of the commands that are passed, command line style to a screensaver to produce the different options.



Hope They Help!

1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro (SP2)
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 8th Dec 2004 12:49
The 'random number' passed on the command line is a handle to the child/preview window that you can write to if you were developing a screen saver in C/C++. Unfortunately, DBP can not use that information.

I mention this in the comments on my screen saver. I got the data from Microsoft's knowledge base. http://support.microsoft.com/default.aspx?scid=kb;en-us;182383

Quote: "Windows ScreenSaver Info:

ScreenSaver - Show the Settings dialog box.
ScreenSaver /c - Show the Settings dialog box, modal to the foreground window.
ScreenSaver /p <HWND> - Preview Screen Saver as child of window <HWND>.
ScreenSaver /s - Run the Screen Saver.
ScreenSaver /a - Show the Password dialog box.

<HWND> is a HWND presented on the command line as an unsigned decimal number.

You need to create the preview window as a child of this window. It should
cover the parent's entire client area.
--
Well, that the theory. But the reality is a bit different. The /a switch is
only called by Windows 95. Since you need DirectX 9.0a for DBPro patch 5, this
is not even an option. Also, what is not covered in the Knowledge Base is that
Windows XP adds more data to the /c option. It tends to look like this:
/c:123456 where 123456 is probably some windows handle.

Since Dark Basic Pro can not write to the /p handle, my solution is to create
a separate preview window. I also do this for the configuration panel. There
are other solutions, some developers use a VB or Delphi screen saver manager to
handle configuration and launching. While this works well and can handle the
preview window problem, it requires a lot more file management. My solution
creates a single executable (screensaver.scr) that you can drop into the
main windows directory (ie. c:\windows)."


--
TAZ

"Do you think it is wise to provoke him?" "It's what I do." -- Stargate SG-1
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 9th Dec 2004 10:16
Well there you go.

1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro (SP2)
Mr Snuggles
20
Years of Service
User Offline
Joined: 7th Dec 2004
Location:
Posted: 11th Dec 2004 06:07
I added code to create separate windows based on command-line parameters, and everything is... most excellent. Thanks for the help.

ooo isn't that precious

Login to post a reply

Server time is: 2025-06-02 13:50:50
Your offset time is: 2025-06-02 13:50:50