Pages

Thursday, 18 August 2011

How to restrict resizing a window

We want to allow user to resize dialog up to certain minimum/maximum dimensions. This can be done by overloading CWnd::OnGetMinMaxInfo in your class. This method is WM_GETMINMAXINFO message handler in which you can set window's maximum and minimum size. This applies to any class derived from CWnd (so including classes derived from CDialog, CFrameWnd, CFormView...).