From: Steve Pick <steve@ba...> - 2003-11-18 18:42:59
Thanks for coming back to the project, nice to finally get to talk to you.
I'm spearheading getting some flicker-free redraws working in Win32::GUI but
whenever I try to double-buffer in a window resize, the flicker just
remains. It looks as though the widgets are redrawn after the window, and so
the widgets arent actually part of the window's DC on resize (?!).
I need to know where and how the widgets are drawn. I'm working with
Here's the process i've been using up to now:
In NEM_WindowMsgLoop, I ignore any WM_ERASEBKGND messages. Then I create a
memory DC that's compatible with the window's DC, and add a bitmap to the
memory DC that's compatible with the bitmap in the window's DC. I fill the
bitmap in the memory DC with the window's background colour, then BitBlt the
window DC over onto the memory DC, then BitBlt the memory DC back into the
I know that this might still leave streaking behind since the streaks will
be part of the window bitmap, but I can fix that once I know that i'm
getting the data I expect for the window contents. Currently I'm just
getting *nothing* at all (flat blank bitmap is copied to memory DC). I even
tried ripping off your code for SaveBMP but that produces nothing either.
Idealy, from what I can gather, every widget should be drawn in a memory DC
(all drawing, erasing backgrounds etc takes place here), the window should
ignore WM_ERASEBKGND (I.e. return (LRESULT) 1 when it receives it to say we
handled it), and the WM_PAINT message should simply cause a BitBlt from the
memory DC into the window's DC. Flicker Gone For Good.
This is my first try at some win32 programming in C / C++ (I'm used to
console or unix stuff) so cut me some slack while I get used to it :)
Thanks in advance,
Steve Pick wrote:
> Thanks for coming back to the project, nice to finally get to talk to you.
> I'm spearheading getting some flicker-free redraws working in Win32::GUI but
> whenever I try to double-buffer in a window resize, the flicker just
> remains. It looks as though the widgets are redrawn after the window, and so
> the widgets arent actually part of the window's DC on resize (?!).
that's interesting. I thought about double-buffering, but never tried
anything. the window DC *should* contains its own widgets (at least,
that's how SaveBMP works). but maybe there's something going on in the message
queue that screw things up, I don't know.
> In NEM_WindowMsgLoop, [...]
wait, wait. are you sure that NEM_WindowMsgLoop is the correct place?
the current code base is a little (ok, a *big*) mess because I was
trying to make the old- and new-event-model to coexist, so maybe
NEM_WindowMsgLoop never gets hit. if you open GUI.h, you'll see there
are two lines at the beginning:
// #define PERLWIN32GUI_DEBUG
// #define PERLWIN32GUI_STRONGDEBUG
uncomment these and rebuild the module. everything will be veeeeeery
slow, but in the console you will see every single thing that's
happening (and which message loop is spinning).
BTW, if you want to send me your code, I can take a look at it and
help you with debugging.
> This is my first try at some win32 programming in C / C++ (I'm used to
> console or unix stuff) so cut me some slack while I get used to it :)
you're really, really welcome :-)
$_=q,just perl,,s, , another ,,s,$, hacker,,print;