Solved

How to set size of MDI child window?

Posted on 1999-01-09
1
264 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

636 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