Solved

How to set size of MDI child window?

Posted on 1999-01-09
1
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
jrmcg earned 50 total points
ID: 1327433
Use the PreCreateWindow function inside the ChildFrm.cpp file
could be MainFrm.cpp
or YouAppChild.cpp

This is the class that creates your frame window.

your function will look like this:

BOOL CMyProgChild::PreCreateWindow(CREATESTRUCT& cs)
{
  int x,y,w,h;
 
  x = TopValue;
  y = LeftValue;
  w = WidthValue;
  h = HeightValue;
  cs.x  = x;
  cs.y  = y;
  cs.cx = w;
  cs.cy = h;
 
  return CMDIChildWnd::PreCreateWindow(cs);
}
This will set the size and position of the window when you open the window.

Hope this helps, if you need more let me know..

J.R.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 9 134
Dell Alienware Graphics Amplifier Driver for non-Alienware systems 18 673
mapBully challenge 6 202
JQuery serialize and unserialize 8 274
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.

752 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