如题!

解决方案 »

  1.   

    CWinApp* pApp = AfxGetApp();
    ASSERT_VALID( pApp );// 1 - Iterate through the application's document
    // templates list
    POSITION posTemplate =
    pApp->GetFirstDocTemplatePosition();
    while( posTemplate != NULL )
    {
    // 2 - For each document template object...
    CDocTemplate* pTemplate =
    pApp->GetNextDocTemplate( posTemplate );
    ASSERT_VALID( pTemplate );
    ASSERT_KINDOF( CDocTemplate, pTemplate );// 3 - Iterate through the template's document list
    POSITION posDocument =
    pTemplate->GetFirstDocPosition();
    while( posDocument != NULL )
    {
    // 4 - For each document object...
    CDocument* pDoc =
    pTemplate->GetNextDoc( posDocument );
    ASSERT_VALID( pDoc );
    ASSERT_KINDOF( CDocument, pDoc );}
      

  2.   

    1。通过AfxGetApp()得到当前的App对象;
    2。通过AfxGetMainWnd()得到主窗口;
    3。通过CMDIFrameWnd::GetActiveFrame得到当前活动窗口;
    4。通过GetNextWindow()遍例所有的子窗口;(如果要得到你想要的子窗口,可以通过特定的成员变量来标志);
      

  3.   

    flyelf(空谷清音)  
       GetWindow遍历?
    怎么实现?可以提供实例参考一下吗?