Jeremy,

> Doing a little searching I came across this page
> http://www.catch22.org.uk/tuts/flicker.asp

The page gives good advice and does exactly what I've already done with
double-buffering. However the problem is that double buffering requires that
widgets are drawn when the main window receives WM_PAINT. Win32::GUI by
default doesnt seem to handle WM_PAINT at all in the window event loop, and
widgets all seem to be drawn somewhere else, and I'm not experienced enough
to fix that.

> Have a look at some of the code in this page:
>
> http://www.codeproject.com/gdi/flickerfree.asp

I dont think I can use this, it seems to do exactly what I've already tried
to implement with my own code, but it doesnt look like it's for drawing
*widgets*. While it claims that converting an MFC app to flickerless mode is
"easy" it actually looks too difficult for me to do it with Win32::GUI, for
exactly the same reason as given above; I cant find where widgets are drawn.

Steve

----- Original Message ----- 
From: "Jeremy White" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <perl-win32-gui-users@lists.sourceforge.net>
Sent: Sunday, November 16, 2003 5:16 PM
Subject: Re: [perl-win32-gui-users] Solution: flicker in Win32::GUI


> >From: "Steve Pick" <[EMAIL PROTECTED]>
> >I've recently been looking into the flickering resize in win32::gui. The
> >most compatible solution to this I've found is extremely (and very
> >annoyingly) simple. Just add the style WS_CLIPCHILDREN to your window or
> >dialog box.
>
> Steve,
>
> I've just tried this and it works...Well, sort of:) On XP, any window
behind
> the window being resized tear as they are redrawn. Also, for some reason
> there seems to be a delay in some of the events to any window with
> WS_CLIPCHILDREN set (!?). In my case, it means I can't use WS_CLIPCHILDREN
> which is a shame since the application looks and feels so *much* better
> without the flicker.
>
> Doing a little searching I came across this page
> http://www.catch22.org.uk/tuts/flicker.asp
>
> ===========
> WM_ERASEBKGND
> The prime suspect is usually the WM_ERASEBKGND message. This message is
sent
> to a window when it's background needs to be erased. This happens because
> windows are usually painted using a 2-stage process:
>
> WM_ERASEBKGND: Clear the background
> WM_PAINT: Draw the contents on top
>
> ....
>
> Right then, how do we avoid erasing the background of a window? There are
> two methods.
>
> Set the window's background brush to NULL. (Set the hbrBackground member
of
> the WNDCLASS structure to zero when you register the window class).
> Return non-zero in the WM_ERASEBKGND message handler.
> Any one of these will steps will prevent the WM_ERASEBKGND message from
> clearing the window. The last option is usually easiest to implement:
>
> case WM_ERASEBKGND:
>     return 1;
> It is also possible to prevent WM_ERASEBKGND when you invalidate and
update
> a window. The InvalidateRect API call's last parameter specifies whether
or
> not a portion of a window is to have it's background erased when it is
next
> redrawn. Specifying FALSE for this paramter prevents WM_ERASEBKGND from
> being sent when the window is redrawn.
>
> InvalidateRect(hwnd, &rect, FALSE);
>
> ============
>
> I've no idea how to write a message handler for WM_ERASEBKGND - any ideas?
> I've played with InvalidateRect in the past but didn't get anywhere fast.
>
> >I tried to implement double-buffering in GUI.xs (I was working with
0.0.558
> >at the time) but frankly I failed.
>
> Have a look at some of the code in this page:
>
> http://www.codeproject.com/gdi/flickerfree.asp
>
> "This article presents a class called CMemDC that encapsulates most of the
> issues associated with writing to off-screen buffers. Adding CMemDC to an
> existing application or MFC Active X control is nearly trivial.
>
> Modifying an MFC Application to use CMemDC
> Add the file memdc.h in your project.
> Add the line #include "memdc.h" to stdafx.h.
> Add a windows message handler for WM_ERASEBKGND. "
>
> Would it be hard to incorporate it into GUI.xs somehow? The code is
> opensource.
>
> Cheers,
>
> jez.
>
> _________________________________________________________________
> Find a cheaper internet access deal - choose one to suit you.
> http://www.msn.co.uk/internetaccess
>
>
>
> -------------------------------------------------------
> This SF. Net email is sponsored by: GoToMyPC
> GoToMyPC is the fast, easy and secure way to access your computer from
> any Web browser or wireless device. Click here to Try it Free!
> https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>


Reply via email to