Re: [AD] Minor flaw in windows example

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


In reply to Chris Jefferson <chris_jefferson2000@xxxxxxxxxx>:
>In the windows scrsave.c example, there is a small flaw. Windows has an 
>annoying habit of rerunning screensavers, i.e. if you set the delay for 
>5 mins, then it runs at 5 mins, 10 mins, 15 mins, etc. etc. This causes 
>the screen saver to slow to a snale's pace if left long enough, so would 
>it be possible to set the screensaver to detect if it is running and if 
>so quit? 

If this is indeed the case, then it should be easy to fix; for instance,
you could use lock files (create, say, c:\windows\temp\scrsave.txt; this
file is deleted on exit, and if it exists when the program starts then
just finish). Or you could use a registry key.

Windows does provide some sort of mechanism for seeing if an application
instance is already in existence, but I don't know it (not being a
Windows person, particularly). Perhaps somebody with the API reference
could point it out?

Bye for now,
-- 
Laurence Withers, lwithers@xxxxxxxxxx
                http://www.lwithers.demon.co.uk/

Attachment: signature.asc
Description: PGP signature



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/