Solved

Opening a MDI document Maximized

Posted on 1999-01-27
4
531 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
  • 2
4 Comments
 
LVL 13

Expert Comment

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

Author Comment

by:nielsew
Comment Utility
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
Comment Utility

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
Comment Utility
Thank you!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

772 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

16 Experts available now in Live!

Get 1:1 Help Now