Correct (pretty) window redraw during the creation

Posted by Coder on Stack Overflow See other posts from Stack Overflow or by Coder
Published on 2010-12-28T15:51:21Z Indexed on 2010/12/28 15:53 UTC
Read the original article Hit count: 225

Filed under:
|
|
|

Does anyone know what is a correct way to redraw window during lengthy initialization operations? Say I have HWND with NULL brush, and it does some not so quick child window initialization (Window initialization is not so quick on Vista and 7, especially on netbooks, even with threaded app).

With this config window stays black for half a second on slower laptops. But if I supply window color brush, it seems that there are some sort of child controls or something that draws black squares on top of it, which also seems ugly. Even though the controls are created without WS_VISIBLE initially.

Oh, the window has the WS_EX_COMPOSITED style, which should do the double buffering to avoid flicker. But it still behaves ugly.

Are there any other tricks I've forgotten, missed?

© Stack Overflow or respective owner

Related posts about Windows

Related posts about winapi