?
Solved

Opening a MDI document Maximized

Posted on 1999-01-27
4
Medium Priority
?
547 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 400 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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 brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

762 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