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);
}
}
}
}
}
}
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);
}
}
}
}
}
}
相关文章推荐
- ArcGIS Server 10.1 错误 service failed to start,
- [LeetCode] Contains Duplicate
- textview constrain count
- AFNetworkingErrorDomain 错误解决方法
- Redmine的创建任务的性能问题
- http://zhidao.baidu.com/link?url=fX6C1xFLsqiuTY88cjwJYal2x52rOwlJstmz7KWyMc6l9j3FHw2yhvp83timZ86pwhqQ8rONj2xkgo2wbU2tLK
- hdu 1021 Fibonacci Again
- Pywinauto在Windows Twain Driver自动化测试中的应用研究
- RAID0,RAID1,RAID10,RAID5各需几块盘才可组建
- Windows 经典的宏——CONTAINING_RECORD
- [USACO Training]二进制数01串
- hdu 1021 Fibonacci Again
- POJ 2527 Polynomial Remains 多项式运算
- poj 1273 Drainage Ditches(最大流)
- AI:确定性AI
- Climbing Stairs
- [CodeForces 300D Painting Square]DP
- zoj 3175 Number of Containers 分块加速
- hdu1848 Fibonacci again and again
- 运项目难点之ScrollView中嵌套百度地图(BaiduMap)的解决方案