Solved

Opening a MDI document Maximized

Posted on 1999-01-27
4
536 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WinWaitActive parameters 12 31
only14 challenge 19 75
abstract class with all non abstract mentods 6 76
Capture logon name 13 70
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 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