CMDIFrame has a MDICLIENT window embedded in it.
The MDICLIENT is automagically resized/repositioned to fit the frame's
client area minus any decorations (toolbars, status bars, etc).
MFC will handle all the repositioning for you if you use a CControlBar
derived object (usually created in OnCreateClient).
Otherwise, you'll need to reposition the windows within the frame yourself.
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
"bhavacakra" <bhavaca...@googlemail.com> wrote in message
news:1191521804.821129.149290@g4g2000hsf.googlegroups.com...
What I'm trying to do is create a tab control at the top of the mdi
frame of a simple application. Here's the relevant code:
afx_msg int ApplicationFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
int r = CMDIFrameWnd::OnCreate(lpCreateStruct);
ASSERT(-1 != r);
r = m_Clientarea.SubclassWindow(m_hWndMDIClient);
ASSERT(r);
CRect tbsz;
GetClientRect(&tbsz);
tbsz.bottom = 100;
r = m_Toolbar.Create(TCS_TABS|WS_VISIBLE|WS_CHILD,tbsz,this,10001);
ASSERT(r);
return r;
}
afx_msg int Toolbar::OnCreate(LPCREATESTRUCT lpCs) {
int r = CTabCtrl::OnCreate(lpCs);
ASSERT(-1 != r);
r = InsertItem(0,_T("Hi"));
ASSERT(-1 != r);
return r;
}
ApplicationFrame is the CMDIFrameWnd and Toolbar is a CTabCtrl. The
tab window is detected by spy++ but it's not visible. What am I
missing ?
Thank you in advance, Flavius