win32: how avoid flickers?

i continue with several problems with flickers :(
i know that i must use WS_CLIPCHILDREN parent style. and Regions, with child controls, for get transparency. but i continue with several problems with flickers :(
can i avoid the WS_CLIPCHILDREN and do a diferent thing?
i have read about the window Double Buffer(i mean for windows and not graphics), but i don't know how use it
What controls are flickering? I believe there a few that support the WS_EX_DOUBLEBUFFERED extended style.

Do you create your window with CS_HREDRAW and CS_VREDRAW class styles?
have you sure?
https://msdn.microsoft.com/en-us/library/windows/desktop/ff700543%28v=vs.85%29.aspx
i don't use class styles

how can i create my own window(s) Double Buffer?
Last edited on
Sorry my mistake. They're control-specific styles. For example tree-view and list-view controls have TVS_EX_DOUBLEBUFFER and LVS_EX_DOUBLEBUFFER. Maybe some other controls have it too.
Forgot to mention that these flags require the common control library 6.0 or later. See this page:

https://msdn.microsoft.com/en-us/library/windows/desktop/bb773175%28v=vs.85%29.aspx

If you use visual studio you can simply add this line to your source:

1
2
3
#pragma comment(linker,"\"/manifestdependency:type='win32' \
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 
you can add:
1
2
case WM_ERASEBKGND:
    return 1;

to your main window procedure.
tath: i use it(TRUE instead 1) ;)
ahcfan: i use Code Blocks ;)

how can i do windows Double Buffer?(i mean windows controls and not the graphics)
I'm still curious what controls are flickering, and if it happens only when you resize the window, and if and how you are updating those controls when the window resizes.

If you don't use Visual Studio you can still enable visual styles by adding something to your application manifest(see the link I posted). This will allow you to use the doublebuffer extended flags for controls that support it.

In my experience simple controls like buttons and edit controls never flicker, but controls with list contents like list-view and tree-view do and those are the ones that support the double buffer style flag.
i'm using a timer for animation with a button, using the WM_PAINT. so i must do:
1
2
case WM_ERASEBKGND:
    return TRUE;

but isn't good, so i must use WS_CLIPCHILDREN parent style and, of course, i use the Double Buffer for draw things.
but if i don't use the WS_CLIPCHILDREN style, i continue with flickers.
Topic archived. No new replies allowed.