Hi, all.

> Since I'm having problems with a flickering statusbar, I tried using
> LockWindowUpdate and got exactly the same results as you! When I call
> LockWindowUpdate(0) the entire screen repaints, in fact the only
> thing that
> doesn't flicker is my statusbar!
>
> Surely this has to be a Windows bug - I'm using NT Workstation 4.0 SP5 -
> what OS are you using?

Hrmm... I don't think so. All that LockWindowUpdate does is defer and
aggregate all the WM_PAINT messages into one large rectangular repaint of
the whole control rather that lots of little repaints of smaller elements,
so it will reduce lots of little flickers into one big flicker which is
sometimes 'good enough'.

To eliminate flicker is a much trickier task and involves overriding the
WM_ERASEBKGND message and rewriting your painting code to only touch each
pixel (or region of pixels) one. I believe Max Nilson (our resident painting
and controls guru) mentioned this technique in an earlier email.

So think Renee of 'All 'Allo 'I will paint you only once....' :-)

Coding in this style involves a little more effort and places a higher load
in terms of CPU usage (region manipulation) on the video bandwidth to your
video card (often much of this stuff is done in card memory) but with modern
Win95 machines and video cards, this is not really a concern.

That is unless you plan to support 486's with older SVGA cards :-) We've run
our code on such a minimal Win95 install spec box and whilst it doesn't
flicker, you can tell the video card and CPU are 'feeling the burn' slightly
:-)

TTFN,
  Paul.


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to