Board index » delphi » Delphi 1 and a screensaver, is there a way to write one without using the Windows API??

Delphi 1 and a screensaver, is there a way to write one without using the Windows API??

Hello to you all,

I'm trying to write a screensaver for Windows 3.1 in Delphi 1.0. I'm
using a C++ program and convert it to Delphi. This C++ program is a
demo from Borland, using OWL and written for Borland C++ 3.1.

But in Delphi there seems to be no way to make it look like pascal.
For almost everything it seems I must substitute the C++ functions to
Window API calls. I can't find a lib file or pascal source (like in
OWL) to make life easy.

Is there no support in any Delphi lib file, or do I overlook
something? Can hardly believe I have to go back to all those API calls
(with all those pointers and so on) to write a screensaver.

Does anybody have a template file or does know what to do?

Greatings,
Charles Collette

 

Re:Delphi 1 and a screensaver, is there a way to write one without using the Windows API??


Charles Collette <collette@wens_geen_e-mail_xs4all.nl> schrieb im Beitrag
<33b301c5.6804...@news.xs4all.nl>...

Quote
> Hello to you all,

> I'm trying to write a screensaver for Windows 3.1 in Delphi 1.0. I'm
> using a C++ program and convert it to Delphi. This C++ program is a
> demo from Borland, using OWL and written for Borland C++ 3.1.

> But in Delphi there seems to be no way to make it look like pascal.
> For almost everything it seems I must substitute the C++ functions to
> Window API calls. I can't find a lib file or pascal source (like in
> OWL) to make life easy.

> Is there no support in any Delphi lib file, or do I overlook
> something? Can hardly believe I have to go back to all those API calls
> (with all those pointers and so on) to write a screensaver.

> Does anybody have a template file or does know what to do?

> Greatings,
> Charles Collette

Just write a delphi program and rename .exe to .scr. Your program has to
affect to command line option /s with starting the saver (the program) an
with /c with a configuration dialog. That's all (in Win 3.1 and higher).
The c lib I think includes a WinMain function for the command lines.

Heiko

luet...@sunpool.cs.uni-magdeburg.de

Re:Delphi 1 and a screensaver, is there a way to write one without using the Windows API??


Quote
Charles Collette <collette@wens_geen_e-mail_xs4all.nl> wrote:
>I'm trying to write a screensaver for Windows 3.1 in Delphi 1.0. I'm
>using a C++ program and convert it to Delphi. This C++ program is a
>demo from Borland, using OWL and written for Borland C++ 3.1.

Forget about all that. You can do it yourself from scratch.

1. respond to command line arguments in your WinMain. If it's a '/s', then
start your saver form; if it's a '/c' then start your config. dialog (if
possible, as the child of the current foreground window); if it's nothing,
then start up your config dialog.

2. Your main saver form should have style WS_POPUP (look at overriding
CreateParams or whatever it's name is). To figure out what size to use (it
should be full desktop size) use GetSystemMetrics(SM_CXSCREEN),CYSCREEN,
or whatever.

3. It should also respond to things like mouse movement and key presses by
quitting itself.

4. For the descriptive name, I forget. It's either STRING resource ID1, or
ID100, or its the module description name that you specify in your .DEF
file.

5. If you can read scrnsave.h then it'd be good.

I have some web pages on the technical details of screensavers
  http://classic.physiol.cam.ac.uk/scr/
but they're mainly focused at Win'95 and WinNT savers; not Win3.1

--
Lucian Wischik, Queens' College, Cambridge CB3 9ET. ljw1...@cam.ac.uk

Other Threads