Board index » delphi » SCREENSAVERS - whats in a name?

SCREENSAVERS - whats in a name?

I'm currently trying to write screensavers in Delphi - this works
fine apart from the fact that I can't compile to a .scr filename.
The documentation claims that you can just rename a .exe to .scr and
Windows' Control Panel will automatically pick it up.  This is true
to a certain extent, but it just appears as ".EXE" in the list, which
obviously isn't good enough.

Is there a way round this?  Some way of smacking the executable about
so that it conforms to Windows' expectations?  Or, even better, a way
of telling Delphi to compile to a certain filename?

Is there an embedded filename that control panel picks up on, like an
embedded icon?

--
 ==============================================================================
 Peter E. Barker                     "though cowards flinch and traitors sneer,
 Desktop Display, Brighton, UK        .....we'll keep the red rag flying here!"
 ==========================  Fear None - Serve All  ===========================

 

Re:SCREENSAVERS - whats in a name?


In article <827445677...@display.co.uk> peter e barker <pbar...@display.co.uk> writes:

Quote
>I'm currently trying to write screensavers in Delphi - this works
>fine apart from the fact that I can't compile to a .scr filename.
>The documentation claims that you can just rename a .exe to .scr and
>Windows' Control Panel will automatically pick it up.  This is true
>to a certain extent, but it just appears as ".EXE" in the list, which
>obviously isn't good enough.

Well, I'm speaking from experience with Borland Pascal, not Delphi, but this
should still be relevant.

Quote
>Is there a way round this?  Some way of smacking the executable about
>so that it conforms to Windows' expectations?  Or, even better, a way
>of telling Delphi to compile to a certain filename?

To answer each question, yes, yes, and probably not.  For each particular
question:

A way around this?  Yes, it's determined by how Windows recognizes a screen
saver by name.  First, it scan's the directory for .SCR files, which *is*
just a renamed .EXE.  After that, it scan's the file's .EXE header for the
proper information, which is the description string, that is in the header
of Windows .EXEs and .DLLs.

Smacking the executable about?  Well, now, we don't have to get {*word*268},
it's a pretty simple addition to your code.

Just add to the beginning of your code:

{$D SCRNSAVE:My Screen Saver}

Windows looks for the "SCRNSAVE:" in the header, and would show "My Screen
Saver" in the desktop list.  Not sure, but you might need a space after the
colon.  I doubt Borland would have changed the directive from BP7 to Delphi.

Compile to another name?  Don't know.  Probably not.  Besides, it's not too
hard to rename the compiled .EXE (from a DOS window ;-).

Quote
>Is there an embedded filename that control panel picks up on, like an
>embedded icon?

See above.

Quote
>--
>==============================================================================
> Peter E. Barker                     "though cowards flinch and traitors
>sneer,
> Desktop Display, Brighton, UK        .....we'll keep the red rag flying
>here!"
> ==========================  Fear None - Serve All
>===========================

--
Scott F. Earnest            | We now return you to our regularly scheduled
sco...@whiplash.res.cmu.edu | chaos and mayhem. . . .

Other Threads