Solved

Opening a MDI document Maximized

Posted on 1999-01-27
4
538 Views
Last Modified: 2013-11-20
At application startup time how do I open a MDI document maximized? Currently I open the document and then maximize it, but it uses a graphics view  so it flashes a bit. I would rather it was already maximized before any graphics are being displayed.

Thanks, Eric
0
Comment
Question by:nielsew
[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
  • 2
4 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1328390
Add style WS_MAXIMIZE to the style of the createwindow function of the MDI client window.
0
 

Author Comment

by:nielsew
ID: 1328391
Do I have to use CreateWindow?

In CChildFrame::PreCreateWindow I added
    cs.style |= WS_MINIMIZE;  
and it works as I would expect

If I use
   cs.style |=WS_MAXIMIZE;
it seems to have no effect


BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    cs.style |= WS_MINIMIZE;  // this works
    return CMDIChildWnd::PreCreateWindow(cs);
}

BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
   cs.style |=WS_MAXIMIZE; // this doesn't work
   return CMDIChildWnd::PreCreateWindow(cs);
}
0
 
LVL 1

Accepted Solution

by:
timop earned 100 total points
ID: 1328392

Call function MDIMaximize()from the message handler of the message WM_CREATE.

int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
      if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
            return -1;
      
      // TODO: Add your specialized creation code here
      MDIMaximize();
      return 0;
}

0
 

Author Comment

by:nielsew
ID: 1328393
Thank you!
0

Featured Post

Technology Partners: 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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.

740 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