没有标题栏的 WS_POPUP 和 WS_OVERLAPPED 有什么区别? [英] What is the difference between WS_POPUP and WS_OVERLAPPED without titlebar?

查看:23
本文介绍了没有标题栏的 WS_POPUP 和 WS_OVERLAPPED 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我为一个样式为 WS_OVERLAPPED 的窗口处理 WM_NCCALCSIZE,我只是简单地返回 0WPARAM> 值为 TRUE.这将删除窗口边框.

If I handle WM_NCCALCSIZE for a window with the style WS_OVERLAPPED, I just simply return 0 when the WPARAM value is TRUE. This removes the window borders.

这样做与创建 WS_POPUP 窗口有什么区别?如果我尝试使用 DwmExtendFrameIntoClientArea 扩展帧,实际帧是否不同? 我应该何时尝试使用每种样式?

What is the difference between doing that, rather than creating a WS_POPUP window? Are the actual frames different if I try to extend the frames using DwmExtendFrameIntoClientArea? And when should I try to use each style?

推荐答案

WS_POPUP 不像以前那么相关了,它向操作系统暗示窗口不太可能是长寿命的,因此可以节省窗口下的显示区域,而不是在窗口关闭时需要重新绘制.例如,由弹出菜单循环或对话框处理的窗口.如果使用得当,这曾经是一个主要的性能优势(尤其是在 win16 时代),我不知道重叠窗口和弹出窗口之间的实际机制有什么不同.

WS_POPUP is not nearly as relevant as it once was, it is a hint to the OS that the window is not likely to be long-lived and thus to save the display area under the window rather than require repainting when the window is dismissed. The window handled by the popup menu loop for example, or dialogs. This used to be a major performance benefit (particularly in the days of win16) when used appropriately, I am not aware of any difference in the actual mechanics between overlapped and popup windows.

这篇关于没有标题栏的 WS_POPUP 和 WS_OVERLAPPED 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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