且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何通过拖动其侧面禁用调整大小的窗口?

更新时间:2022-05-23 06:51:48

我假设我们在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[^]