Click to See Complete Forum and Search --> : How can I maximize the first View at my MDI app
eyalz
May 24th, 1999, 07:19 AM
Hi!
I need to make the FIRST VIEW in an MDI
app the entire size of the client area of
the main frame window, but not *MAXIMIZED*
(i.e. - like I dragged it to the right-bottom
corner...)
Regards,
Eyal
Dave Lorde
May 24th, 1999, 09:02 AM
Here's how I do it. Insert the code between the rows of asterisks into your CWinApp-derived class's InitInstance() function, just after the call to ProcessShellCommand() that creates the first child window. I use NegotiateBorderSpace() to calculate the space occupied by the toolbar and status bar, since GetClientWindow() doesn't:
BOOL CMyApp::InitInstance()
{
...
if (!ProcessShellCommand(cmdInfo))
return FALSE;
//**************************************************
CFrameWnd* pChildFrame = pMainFrame->GetActiveFrame();
CRect rectBorder;
pMainFrame->NegotiateBorderSpace(CFrameWnd::borderGet, &rectBorder);
CRect clientRect(0,0,0,0);
clientRect.right = rectBorder.Width() - GetSystemMetrics(SM_CXSIZEFRAME);
clientRect.bottom = rectBorder.Height() - GetSystemMetrics(SM_CYSIZEFRAME);
pChildFrame->MoveWindow(&clientRect);
//**************************************************
...
}
Dave
eyalz
May 25th, 1999, 03:07 AM
Thanks, dave!
In order for it to work properly,
I put the code between
ShowWindow() and UpdateWindow()!
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.