CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;// Get the active MDI child window. CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();// Get the active view attached to the active MDI child window. CMyView *pView = (CMyView *) pChild->GetActiveView();
while (pos != NULL)
{
CView* pView = GetNextView(pos);
pView->UpdateWindow();
}
//3,通过文档获得视图,
//这是一段最小化所有窗口的代码,编历所有View希望对你有所启发:)void CImageProcessApp::OnMinimizeAll()
{
POSITION pos = GetFirstDocTemplatePosition();
CDocTemplate* pDocTempl = NULL;
while(pos)
{
pDocTempl = GetNextDocTemplate(pos);
POSITION posDoc = pDocTempl->GetFirstDocPosition();
while(posDoc)
{
CDocument *pDoc = pDocTempl->GetNextDoc(posDoc);
POSITION posView = pDoc->GetFirstViewPosition();
while(posView)
{
pDoc->GetNextView(posView)->GetParent()->ShowWindow(SW_MINIMIZE);
}
}
}
}
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();// Get the active view attached to the active MDI child window.
CMyView *pView = (CMyView *) pChild->GetActiveView();