您的位置:首页 > 大数据 > 人工智能

MFC CMainFrame 获得所有子窗体(一)

2015-08-13 15:36 316 查看
CObList lstFrames;

CDocManager *pDocManager = AfxGetApp()-> m_pDocManager;

POSITION pos = pDocManager-> GetFirstDocTemplatePosition();

while(pos)

{

CDocTemplate* pTemplate = (CDocTemplate*)pDocManager-> GetNextDocTemplate(pos);

{

POSITION pos = pTemplate-> GetFirstDocPosition();

while (pos)

{

CDocument* pDoc = pTemplate-> GetNextDoc(pos);

{

POSITION pos = pDoc-> GetFirstViewPosition();

while(pos)

{

CView *pView = pDoc-> GetNextView(pos);

CFrameWnd *pFrame = pView-> GetParentFrame();

if(lstFrames.Find(pFrame) == NULL)

{

lstFrames.AddTail(pFrame);

}

}

}

}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: