Board index » delphi » Weird Screen saver problem - Delphi 16 / w

Weird Screen saver problem - Delphi 16 / w

In article 0...@winstar.demon.co.uk, t...@winstar.demon.co.uk (Tim Winstanley) writes:

Quote
>I have come across a weird problem with a 16 bit screen saver, running on an
>LCD screen. When the screensaver is active everything appears ok. When it is
>terminated, the screen often looks "odd" as if it needs redrawing. If I
>manually minimize and then maximise program manager everything seems to get
>redrawn, however if I programatically use enumwindows to redraw all the
>windows it has no effect.

>Has anybody got the slightest idea what might be causing this ?
>The screen is a monochrome lcd driven by a 16 colour tseng driver.
>Can display drivers be called directly to force it to repaint the screen ?

>Thanks

>Tim Winstanley
>Worcester
>UK

Instead of enumerating over all the windows, try the
following:

  InvalidateRect(GetDesktopWindow, nil, 0);

Sorry for any syntax errors as it is from the top
of my head.  What this call does is to force each
window to repaint itself by tricking the applications
to think the background needs repainting.

Best regards,
Michael Vincze
vin...@ti.com

 

Re:Weird Screen saver problem - Delphi 16 / w


Quote
>Instead of enumerating over all the windows, try the
>following:

>  InvalidateRect(GetDesktopWindow, nil, 0);

>Sorry for any syntax errors as it is from the top
>of my head.

        Actually that doesn't quite do it - it redraws the desktop but not
windows sitting on the desktop. (Try drawing a large rectangle on GetDC(0)
and then do the above if you don't believe it.) But you can just do

InvalidateRect(0, nil, True);

        and it works. (OTOH I didn't realize that nil worked for the PRect.)

--
David Ullrich
Don't you guys find it tedious typing the same thing
after your signature each time you post something?
I know I do, but when in Rome...

Other Threads