|
-
May 24th, 1999, 09:02 AM
#2
Re: How can I maximize the first View at my MDI app
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|