windows Win32中的RedrawWindow和UpdateWindow有什么区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7360500/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 18:02:25  来源:igfitidea点击:

What are the differences between RedrawWindow and UpdateWindow in Win32?

c++windowswinapivisual-c++window

提问by jondinham

What are the differences between RedrawWindow and UpdateWindow in Win32?

Win32中的RedrawWindow和UpdateWindow有什么区别?

Since they seem to have the same purpose to refresh a window, what are the differences?

既然它们似乎具有相同的刷新窗口的目的,那么它们之间的区别是什么?

回答by David Heffernan

RedrawWindowis typically used to force a redraw of the entire window (or some specified region within) right now.

RedrawWindow通常用于立即强制重绘整个窗口(或其中的某些指定区域)。

UpdateWindowwill force a redraw of only the update region of the window, i.e. that part of the window that has been invalidated (e.g. by calling InvalidateRect) since the last paint cycle.

UpdateWindow将仅强制重绘窗口的更新区域,即InvalidateRect自上次绘制周期以来已失效(例如通过调用)的窗口部分。