Solved

Preventing the sizing of the CView derived class

Posted on 2000-04-05
4
286 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:Mindo
  • 2
4 Comments
 
LVL 4

Expert Comment

by:captainkirk
ID: 2687023
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
 
LVL 31

Accepted Solution

by:
Zoppo earned 50 total points
ID: 2687045
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
 
LVL 3

Expert Comment

by:MDarling
ID: 2687052
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
 
LVL 3

Expert Comment

by:MDarling
ID: 2687056
woah - Zoppo's too quick :)

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question