如何通过拖动其侧面禁用调整大小的窗口? [英] how to diable resizing window by dragging its sides?

查看:83
本文介绍了如何通过拖动其侧面禁用调整大小的窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想允许我的应用程序的用户调整窗口的大小.
窗口可以通过两种方式调整大小
1.通过最大化框
2.通过拖动窗口的侧面

enhzflep教我如何禁用最大化按钮.现在我想知道第二个

i dont want to allow the user of my application to resize the window.
window can be resize by two ways
1. through maximizebox
2. by dragging window''s sides

enhzflep taught me how to disable maximize button. now i want to know the second

推荐答案

我假设我们在Windows上.

创建窗口时,请确保窗口样式(dwStyle)标志不包含WS_THICKFRAME.
或者,您可以处理窗口消息WM_SIZING以将对用户所做的大小的任何更改还原.
I''m assuming we''re on Windows.

When you create the window make sure that the window style (dwStyle) flags doesn''t include WS_THICKFRAME.
Or you could handle the window message WM_SIZING to revert any changes to the size the user has made.


要控制窗口的x和y大小,可以处理WM_GETMINMAXINFO消息并返回您愿意接受的最小值,该值只能是当前窗口的大小,这意味着不允许更改.

Bing/Google/Yahoo搜索WM_GETMINMAXINFO以获取详细信息.另外,本文可能会有所帮助.
http://www.olivierlanglois.net/minmaxdemo.html [
To control the x and y sizes of the window, you can handle the WM_GETMINMAXINFO message and return the smallest you are willing to accept, which can just be the size of the current window, meaning no change allowed.

Bing / Google / Yahoo Search for WM_GETMINMAXINFO for details. Also, this article may help.
http://www.olivierlanglois.net/minmaxdemo.html[^]


这篇关于如何通过拖动其侧面禁用调整大小的窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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