rt

解决方案 »

  1.   

    Returns the top-level CWnd whose window class is given by lpszClassName and whose window name, or title, is given by lpszWindowName.static CWnd* PASCAL FindWindow(
       LPCTSTR lpszClassName,
       LPCTSTR lpszWindowName 
    );
      

  2.   

    若是两个不同的进程,只能用 FindWindw(),这是我知道的方法。在同一个进程里,可以用全局变量(建议少用),也可以用静态类成员。
      

  3.   

    Example
    // activate an application with a window with a specific class name
          BOOL COneT32App::FirstInstance()
          {
             CWnd *pWndPrev, *pWndChild;         // Determine if a window with the class name exists...
             if (pWndPrev = CWnd::FindWindow(_T("MyNewClass"),NULL))
             {
                // If so, does it have any popups?
                pWndChild = pWndPrev->GetLastActivePopup();            // If iconic, restore the main window
                if (pWndPrev->IsIconic())
                   pWndPrev->ShowWindow(SW_RESTORE);            // Bring the main window or its popup to the foreground
                pWndChild->SetForegroundWindow();            // and you are done activating the other application
                return FALSE;
             }
          }
      

  4.   

    static CWnd* PASCAL FindWindow(
       LPCTSTR lpszClassName,
       LPCTSTR lpszWindowName 
    );找到另一个对话框得句柄,然后操作
      

  5.   

    说明一下我的程序先.我的程序是在主对话框上用了一个CPropertySheet,
    在CPropertySheet中又包含了两个对话框, 就是那种Tab界面.
    现在在主对话框中的一个函数需要更新某一个Tab界面上的一个控件.
      

  6.   

    在属性页上面添加控件的变量m_ctrl
    CPropertySheet m_sheet;
    m_sheet.m_page1.m_ctrl.UpdateData(false);
      

  7.   

    m_sheet.m_page1  ?
    请问一下, m_page1 是m_sheet的成员? thx