c++ - flicker free tab control with WS_EX_COMPOSITED -


i have vs2008 c++ application windows xp sp3 developed using wtl 8.1. application contains tab control flickers when application border resized.

my window hierarchy looks this:

cframewindowimpl   cmainfrm |-csplitterwindow  splitter   |-ctabview       configuration tabs   | |-cdialogimpl  configuration view 1   | |-cdialogimpl  configuration view 2   | |-cdialogimpl  configuration view 3   |-cdialogimpl    control view 

the solution i'm trying make cframewindowimpl derived class use ws_ex_composited style , windows beneath use ws_ex_transparent style. unfortunately, makes tab control buttons show empty black bar , controls of configuration view not show @ all.

if remove ws_ex_composited , ws_ex_transparent styles, form displays properly, ctabview , beneath flickers horribly when resized.

what need change eliminate flicker , draw controls properly?

thanks, paulh


edit: got working. removed ws_ex_transparent styles per mark ransom's suggestion. put ws_ex_composited style on only ctabctrl (contained within ctabview). other controls double-buffering needed through wtl::cdoublebufferimpl<>.

a window flickers because gets erased before it's drawn. eliminate need disable erasing of window entirely , use double buffering - draw window contents bitmap, copy bitmap window. because bitmap contains entire contents including background, there's no need erase anymore.

it looks ws_ex_composited handle double buffering automatically, still need use null background brush and/or handle wm_erasebkgnd message.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -