Re: Redraw Issue
- Posted by Derek Parnell <ddparnell at bigpond.com> Aug 04, 2001
- 517 views
Hi, ----- Original Message ----- From: <euman at bellsouth.net> To: "EUforum" <EUforum at topica.com> Subject: Re: Redraw Issue > > Here is some code I personally use for window resize. > It's rather quick to see that InvalidateRect would > force a repaint of the entire Window. > > Possibly (not haveing looked first) that the library > you use to handle this is forceing more than one > InvalidateRect or haveing a Paint event tied closely > to this.... > > When I use the routine (below) to resize windows, even on a > somewhat slow 233mhz machine, I experience 0 (zero) > flicker........tested with 20+ controls in the client as well.... [SNIP] The issue is not with resizing per se, it is about the use of the CS_HREDRAW and CS_VREDRAW window styles. Simply put, if one uses these styles a flicker effect is introduced, if you don't use them there is no flickering. The flickering is noticed during a resize but ONLY if these styles are used. It appears that, when using these styles, Windows first sets all the pixels to COLOR_WINDOW and displays your "updated" window, then issues the WM_SIZE message. If you don't use these styles, the app still gets a WM_SIZE message but Windows hasn't wiped your window first. With the sample code you supplied, does that apps that use this code also have the CS_xREDRAW styles or not? This seems to be the key to it. > ck, your answer about the window being smooth in the demo I > sent you answers my question about your hardware. There is nothing > wrong with it.....Its must be your code or the library you are useing! > The Win32Lib library doesn't do anything with the WM_SIZE or WM_PAINT messages, except call an app defined handler if one was set. Oh, an WM_RESIZE also automatically resizes any toolbar or statusbar if they were created. Should the library be doing something? In other words, is there some activity that every app should be doing when they receive a WM_SIZE message? ---- Derek.