|
-
May 24th, 1999, 07:19 AM
#1
How can I maximize the first View at my MDI app
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
-
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
-
May 25th, 1999, 03:07 AM
#3
Re: How can I maximize the first View at my MDI app
Thanks, dave!
In order for it to work properly,
I put the code between
ShowWindow() and UpdateWindow()!
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
|