WM_SIZE和Vista [英] WM_SIZE and Vista

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

问题描述

我遇到的问题是,在Vista x64下,某些WM_SIZE消息消失了,而在所有其他Windows下,它都能正常工作.

I have trouble that under Vista x64 some WM_SIZE messages dissapear, under all other Windows it works fine.

在我的应用程序中,我具有非常复杂的拆分器结构.当我更改主窗口的大小时,该错误出现.在这种情况下,WM_SIZE消息是由拆分器的第一层和第二层获取的,而不是由第三层获取的.但是,当我更改第一层拆分器的位置时,会得到WM_SIZE.

In my application I have very complex splitter structure. The bug appear when I change size of main window. In this case WM_SIZE message is got by the first and the second layer of splitter and is not got by third layer. However when I change position of splitter of first layer - WM_SIZE is got.

每层都由同一个MFC类实现.

Every layer is implemented by the same MFC class.

我发现WM_WINDOWPOSCHANGED的默认处理程序(DefWindowProc)以不同的方式处理(即,将相同的数据放入此函数会导致不同的行为).这就是原因.

I found that default handler (DefWindowProc) of WM_WINDOWPOSCHANGED is processed in different ways (i.e. the same data putted into this function cause different behaviour). This is the reason.

如何解决此问题?

P.S.

我在Visual Studio中遇到类似的问题.在更改分割线位置之前,有时不绘制任何框架.

Similar issues I have with Visual Studio. From time to time some of frames are not drawn at all until I change splitter position.

推荐答案

我为不同版本的Windows开发了软件,您谈论的许多事情都发生在这些窗口中.在大多数情况下,这似乎不是Windows的错误,因为我发现很多使用 SetWindowPos API且带有标志的窗口或控件,这些标志不会导致发送WM_SIZE消息.您可以处理WM_WINDOWPOSCHANGED(并且无需再次处理WM_SIZE)来解决它.

I've developed softwares for different versions of windows, many of the things you talking about happened in these windows. It seems not bugs of the windows in most of cases because i've found many windows or controls using SetWindowPos API with flages that cause no WM_SIZE messages being sent. You can handles WM_WINDOWPOSCHANGED (and without WM_SIZE being handled again) to solve it.

 


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

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