When the MDI child window is maximized the caption (document title) is drawn by DefMDIChildProc.
In addition to the above override to CMainFrame::OnUpdateFrameTitle add a handler to the CChildFrame class to handle WM_CHILDACTIVATE -
void CChildFrame::OnChildActivate()
{
CMDIChildWndEx::OnChildActivate();
if (IsZoomed())
SetWindowText(_T(""));
else
CMDIChildWndEx::OnUpdateFrameTitle(TRUE);
}
I haven't tested for all possibilities. One side effect of the above is that when the title of the MDI child is removed it is also removed from the Window menu.
I don't quite understand the purpose of removing the document title when the MDI child is maximized. If more than one MDI child window is open it obscures the identity of the window in which the user is working.