Link to home
Start Free TrialLog in
Avatar of nielsew
nielsew

asked on

Opening a MDI document Maximized

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
Avatar of Mirkwood
Mirkwood

Add style WS_MAXIMIZE to the style of the createwindow function of the MDI client window.
Avatar of nielsew

ASKER

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);
}
ASKER CERTIFIED SOLUTION
Avatar of timop
timop

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nielsew

ASKER

Thank you!