在vc中窗口A中有按钮,点击打开窗口B,我有多个窗口,但是没办法调用,我是一个初学者

解决方案 »

  1.   

    HWND CreateWindowEx(
      DWORD dwExStyle,      // extended window style
      LPCTSTR lpClassName,  // registered class name
      LPCTSTR lpWindowName, // window name
      DWORD dwStyle,        // window style
      int x,                // horizontal position of window
      int y,                // vertical position of window
      int nWidth,           // window width
      int nHeight,          // window height
      HWND hWndParent,      // handle to parent or owner window
      HMENU hMenu,          // menu handle or child identifier
      HINSTANCE hInstance,  // handle to application instance
      LPVOID lpParam        // window-creation data
    );
    HWND CreateWindow(
      LPCTSTR lpClassName,  // registered class name
      LPCTSTR lpWindowName, // window name
      DWORD dwStyle,        // window style
      int x,                // horizontal position of window
      int y,                // vertical position of window
      int nWidth,           // window width
      int nHeight,          // window height
      HWND hWndParent,      // handle to parent or owner window
      HMENU hMenu,          // menu handle or child identifier
      HINSTANCE hInstance,  // handle to application instance
      LPVOID lpParam        // window-creation data
    );
      

  2.   

    CADlg::OnButton1()
    {
        CBDlg dlg;
        dlg.DoModal();
    }这样就OK
      

  3.   

    CADlg::OnButton1()
    {
        CBDlg dlg;
        dlg.DoModal();
    }这样显示以后,只要最小化这个窗体B,则窗体A也就最小化了而且不能进行别的操作