Solved

How to set size of MDI child window?

Posted on 1999-01-09
2
599 Views
Last Modified: 2013-11-20
I have a MDI application and wish to fix the size and position of a child window. I found that I need to use SetWindowPos but do not know when I should call it. Please advice. Thanks.
0
Comment
Question by:lim_cheryl
2 Comments
 

Expert Comment

by:PavelY
ID: 1327434
Hi,

Use SetWindowPos whenever you want to change the size (or position) when the window exists.
If you want to change size or position before the window is created, override CWnd::PreCreateWindow, and chage the x,y,cx,cy members of the CREATESTRUCT appropriately.

0
 
LVL 3

Accepted Solution

by:
plaroche earned 50 total points
ID: 1327435
1) SetWindowPos as previously said can be used in OnCreate in your window.

2) To fix the size you need to handle WM_GETMINMAXINFO. This override will allow you to prevent the sizing beyond a certain point. Other wise try handling OnMove and OnSize, without calling the base class.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 102
Line meaning 9 89
wordcount challenge 11 144
wordappend challenge 8 220
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 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