Win32 GUI flickering on resize

青春壹個敷衍的年華 提交于 2019-12-01 18:18:40

It turned out there was a problem with the Z-ordering - calling BringWindowToTop on the list view solved the problem.

Windows supports a re-size batching operation that is meant to avoid flicker caused when lots of child windows are indepently resized. See BeginDeferWindowPos for more information on that.

If that is not working, then try the WM_SETREDRAW message. It looks possible to stop drawing of the parent window - which will inhibit all the child controls, then, when the layout is finished, enable drawing again, and call RedrawWindow to repaint the entire window in one pass. I did rather think that this is what Defered window positioning would use internally.

Eran Medan

I may be stating the obvious, but I thought double buffering is the solution to Win32 flickers. I'm a Java Developer and it has been a while sine I wrote win32 so please let me know if I'm talking nonsense

Here is the how to: http://www.gamedev.net/community/forums/topic.asp?topic_id=411559

Here is some sampe code: http://www.codeproject.com/KB/cpp/DoubleBuffering.aspx

Here is the .NET equivalent question (?): How to prevent a Windows Forms TextBox from flickering on resize?

When a ListView is Docked, as in Windows Explorer (and you have a good amount of items), resizing the main form will cause all of the items to flicker. http://www.codeproject.com/KB/list/listviewxp.aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!