Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

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.
 
Share this answer
 
v2
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[^]
 
Share this answer
 
Comments
Simon Bang Terkildsen 1-Oct-11 13:35pm    
+5. I'm amazed that I didn't know about that one.
Chuck O'Toole 1-Oct-11 13:38pm    
Thanks. Can anyone truly know all the wonderfullness that is Windows? :)
Simon Bang Terkildsen 1-Oct-11 13:58pm    
No I guess not :)
It just seems like a message one would trip over sooner or later, it took me 16 year to trip over it, granted I haven't been playing around with win32 much the past 5-6 years, but still :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900