tags:

views:

79

answers:

2

I have tried several methods, but problems always exist. Sometimes the sub-window didn't refresh and sometimes the sub-window will keep blink. This is a sample project that i have written http://rapidshare.com/files/283950611/TestProject.7z.html

My method to implement that is: Put a scroll bar on the top of sub-window, whenever the scroll bar was dragged, the sub-window would be moved as well.

And every dialog is inherited from CDialogBase, All the drawing is done in this class, Drawer.h is a helper for drawing. Only when the DC that user assigned is dirty, then system will redraw the window, it is used for accelerating the painting.

A: 

Have you considered using WS_EX_LAYERED and then using UpdateLayeredWindow. It can get quite complicated but allows for things like per-pixel alpha and eliminates flicker like you are seeing.

Look here: http://www.nuonsoft.com/blog/2009/05/27/how-to-use-updatelayeredwindow/

for more info.

Goz
A: 

WS_EX_LAYERED only can be added to with top level window, not sub-window; I've tried to modify the window style from WS_CHILD to WS_OVERLAPPED, and then using layed window, and then clip the visiable area of the window, but, the result is not what I expected.

Anywhere, thank you for your advice...

Lixiang Xie