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