发布到消息队列WM_ERASEBKGND消息? [英] Are WM_ERASEBKGND messages posted to the message queue?

查看:240
本文介绍了发布到消息队列WM_ERASEBKGND消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WM_PAINT 消息不被发布到消息队列中,而当消息队列为空,则 WM_PAINT 消息被发送到窗口过程(如果窗口的一些区域是无效的)。

WM_PAINT messages are not posted to the message queue, but rather when the message queue is empty, the WM_PAINT message is sent to the window procedure (if some area of the window is invalid).

然而, WM_ERASEBKGND 在一些类似的方式发送的信息,或者他们只是发布到消息队列(中的文档不说这事)。

However, are WM_ERASEBKGND messages sent in some similar way, or are they simply posted to the message queue (the documentation don't say anything about this).

推荐答案

有两种,不是非典型的Windows消息。它会在程序执行像UpdateWindow一个命令时()发送或处理类似WM_SYSCOMMAND一条消息,移动或调整窗口大小。当程序已呼吁InvalidateRect(),它会发布

It is both, not untypical for Windows messages. It will be sent when the program executes a command like UpdateWindow() or processes a message like WM_SYSCOMMAND that moves or resizes the window. It will be posted when the program has called InvalidateRect().

同样如此WM_PAINT,通常是贴的消息,但只能通过GetMessage函数()返回时,消息队列为空。它然而,当你该调用UpdateWindow()将被发送,保证了窗口,当它返回时画的。

Same is true for WM_PAINT, normally a "posted" message but only returned by GetMessage() when the message queue is empty. It however will be sent when you call UpdateWindow(), ensuring the window is painted when it returns.

不采取这些执行细节的依赖是pretty重要的。

Not taking a dependency on those implementation details is pretty important.

这篇关于发布到消息队列WM_ERASEBKGND消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆