POSITION pos = AfxGetApp()->GetFirstDocTemplatePosition();
CDocTemplate* pMDoc = AfxGetApp()->GetNextDocTemplate(pos);
POSITION pos1 = pMDoc->GetFirstDocPosition();
while (pos1 != NULL)
{
CDocument* pDoc = pMDoc->GetNextDoc(pos1);
CMainFrame *pMF = ((CMainFrame*)AfxGetMainWnd());
CView *pView = pMF->GetActiveView();
AfxMessageBox(pDoc->GetTitle());
{
// pMF->MDIActivate(pWnd); //激活某个MDI子窗口(创建时可记录指针)
pMF->MDINext(); //激活下一个子窗口
}
}
or
if you do not use the framework to manage your MDI child windows.call the member function
CMDIFrameWnd::MDISetMenu