Preventing the sizing of the CView derived class

I have a CView derived class and i want to restrict sizing of this window till some specific size.

I tried to do this in OnSize() and OnWindowPosChanged() events, but they didn't work.

Can anybody post a few lines of code how to do this?

Thanks.
LVL 2
MindoAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ZoppoConnect With a Mentor Commented:
Hi Mindo,

override the WM_GETMINMAXINFO handler CWnd::OnGetMinMaxInfo() for the view's frame window class (the CChildFrame) and set min and max tracking size of the passed MINMAXINFO as you need them.

hope that helps,

ZOPPO
0
 
captainkirkCommented:
Is this an MDI or SDI app??

If you want the main frame to remain the same size, you can specify that it can't be resized by turning the WS_THICKFRAME style off in your main frame class' PreCreateWindow() function.
0
 
MDarlingCommented:
You should respond to WM_GETMINMAXINFO.

and set the ptMinTrackSize and ptMaxTrackSize to the same value that
you want your view to be.

regards,
Mike.
0
 
MDarlingCommented:
woah - Zoppo's too quick :)

0
All Courses

From novice to tech pro — start learning today.