请问高手们:我现在获得当前父窗口的句柄,如何获得它的子窗口包括层叠窗口的句柄啊?
谢谢!!!!

解决方案 »

  1.   

    你baidu一下spy++的源代码,就知道了
      

  2.   

    EnumChildWindow在回调函数中处理
      

  3.   

    CMyApp * pMyApp = (CMyApp *)AfxGetApp();
    POSITION  p = pMyApp->GetFirstDocTemplatePosition();
    while(p!= NULL) {
    CDocTemplate * pDocTemplate = pMyApp->GetNextDocTemplate(p);
    POSITION p1 = pDocTemplate->GetFirstDocPosition();
    while(p1 != NULL) {
    CDocument * pDocument = pDocTemplate->GetNextDoc(p1);
    POSITION p2 = pDocument->GetFirstViewPosition();
    while(p2 != NULL) {
    CView * pView = pDocument->GetNextView(p2);
    }
    }
    }
      

  4.   

    BOOL CALLBACK wndProc(HWND hwnd, LPARAM lParam)
    {
    TRACE("%ld\n", hwnd);
    return (NULL != hwnd);
    }void CDialogTestDlg::OnOK() 
    {
    CWnd *pWnd = FindWindow("SciCalc", NULL);
    if (NULL == pWnd) 
    {
    return;
    }
    EnumChildWindows(pWnd->GetSafeHwnd(), (WNDENUMPROC)wndProc, NULL);
    }简单的就是这样, 你开一个 windows 自带的"计算器", 然后运行, 会TRACE出所有的子窗体
      

  5.   

    上面说的都不是我说的那种:不过还是谢谢大家
    层叠指的是窗口下的Sheet页面
      

  6.   

    窗口下的Sheet页面??只要是WS_CHILD风格用EnumChildWindows肯定是可以的