捕获最后的WM_SIZE [英] capture the last WM_SIZE

查看:203
本文介绍了捕获最后的WM_SIZE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我调整窗口大小时,我想告诉程序的另一部分,我的窗口改变了大小。我在 MSDN 上阅读:

When I resize my window I want to tell another part of my program that my window has changed size. I read on MSDN that:

WM大小消息

WM SIZE消息在大小更改后发送到窗口。

但是,即使拖动,我也会收到WM_SIZE。
我注意到,还有一个WM_SIZING消息,当我的窗口正在调整大小时发送。目前我没有看到WM_SIZE和WM_SIZING之间的区别。

However, I receive the WM_SIZE even when dragging. I noticed that there is also a WM_SIZING message that is sent when my window is resizing. At the moment I do not see the difference between WM_SIZE and WM_SIZING.

有一些方法,我可以捕获最后一个WM_SIZE消息,因为不是垃圾邮件我的程序

Is there some way I can capture the very last WM_SIZE message, as to not "spam" my program with resize messages?

推荐答案

当您开始拖动窗口时,系统进入模态移动/调整大小循环;它不会返回到您自己的消息循环,直到拖动操作完成。您仍然得到 WM_SIZE ,因为它直接发送到窗口过程,但不会流过您自己的消息循环。

When you start dragging a window, the system enters a modal move/resize loop; it does not return to your own message loop until the drag action has finished. You are still getting WM_SIZE because it is sent directly to the window procedure, but it does not flow through your own message loop.

在这种模态拖动操作开始时,系统会发送 WM_ENTERSIZEMOVE 到您的窗口过程。当您释放鼠标按钮时,您的应用程序将获得 WM_EXITSIZEMOVE 。这可能是您要触发的邮件。

At the beginning of such a modal drag action, the system sends WM_ENTERSIZEMOVE to your window procedure. When you release the mouse button, your application will get WM_EXITSIZEMOVE. That is probably the message you want to trigger on.

这篇关于捕获最后的WM_SIZE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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