MFC CFrameWnd Client size
drjackool
956
Reputation points
Hi
I using MFC in my project. MFC by defaults fills window client by a just one window/control I want add extra window to my app (except toolbar and status bar) How should I override CFrameWnd::RecalcLayout() function?
Is following my code correct?
I ask this because I think RepositionBars function has overhead (like other ugly MFC stuffs!) and called twice! My app has just CReBar and CStatusBar control in top and bottom. How resize them without RepositionBars function?
thanks in advance
void CMainFrame::RecalcLayout(BOOL bNotify)
{
CRect rectClient;
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0, CWnd::reposQuery, &rectClient, NULL, TRUE);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0, CWnd::reposDefault, NULL, NULL, TRUE);
// reposition other controls myself here
}
Sign in to answer