Solved

How to set size of MDI child window?

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Turn a spreadsheet into a vba executable. 2 66
unable to delete all specified values regedit 38 155
sumNumber challenge 16 99
Line meaning 9 77
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: 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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

747 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

8 Experts available now in Live!

Get 1:1 Help Now