Solved

How to set size of MDI child window?

Posted on 1999-01-09
2
594 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASCII Non-Printable characters/codes and their HTML equivalents 6 104
conditional code and condition difference 9 76
sum28 challenge 31 105
only14 challenge 19 68
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

930 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now