Disabling Window Resizing

How do I prevent the user from resizing the window? Does ignoring WM_SIZE do that or I need to change some settings?
Respond to the WM_GETMINMAXINFO message.
http://www.google.com/search?btnI=1&q=msdn+wm_getminmaxinfo

A window must have the WS_THICKFRAME or WS_CAPTION style to receive WM_GETMINMAXINFO. A window with the WS_THICKFRAME style receives this message during the window-creation process, as well as when it is being moved or sized.
Win32 Programmer's Reference, "Size and Position Messages"

If you do allow resizing, you can moderate it further by processing the WM_SIZING message.

This all assumes your window has the WS_THICKFRAME style attribute (and does not have the WS_EX_TOOLWINDOW extended style attribute).

Hope this helps.
use a combination of this during CreateWindow()

WS_OVERLAPPED | WS_MINIMIZEBOX | WS_SYSMENU
Normally you would just create a non-resizeable window, as sharma has suggested. If you don't want to do that for some reason, then you need something more complicated as Duoas has suggested.
I read an example which includes processing the WM_SIZE message, but WS_THICKFRAME and WS_CAPTION are not used! And the window CAN be resized easily by dragging the edges using the mouse. So resizing is allowed. Minimizing and maximizing work too.

1. If I use fullscreen mode (allowing switching to windowed mode and back to fullscreen anytime), will disabling window resizing be a problem or it has nothing to do with this?

2. Which styles DO disable window resizing? (both by dragging and by minimizing and maximizing)

3. Can I change the window size in the code (after the window has been created)? If yes, how?


Last edited on
I found the problem! Thanks for your help! I used the style WS_OVERLAPPEDWINDOW, which includes minimizing , maximizing and resizing...now I understand. :)
Topic archived. No new replies allowed.