在 Win32 上,我可以在一段时间内禁用窗口绘制吗?
当我更改对话框的布局时,是否有一个函数可以将窗口重绘冻结一段时间?
Is there a function that will freeze window repainting for some time, while I do changes to the layout of my dialog?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(3)
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如果您发现确实需要执行此操作,则应向窗口发送
WM_SETREDRAW
消息,其中wParam
设置为 FALSE。这表明窗口的内容更改后不应重新绘制。当您想要重新启用绘图时,请发送另一条
WM_SETREDRAW
消息,这次将wParam
设置为 TRUE。示例代码:
有关详细信息,请参阅 Raymond Chen 的博客文章主题是一本很棒的读物。
If you find that you actually need to do this, you should send the window a
WM_SETREDRAW
message with thewParam
set to FALSE. This indicates that the window should not be redrawn after its contents are changed.When you want to re-enable drawing, send another
WM_SETREDRAW
message, this time with thewParam
set to TRUE.Sample code:
For more information, Raymond Chen's blog article on the subject is a great read.