基于对话框的程序,两个对话框A(主对话框)、B(手工建立),A调B,要求A始终显示在B的上面,我用,请帮忙,详细介绍,谢谢。

解决方案 »

  1.   

    1、用模式对话框
    2、用非模式对话框
       在对话框的初始化函数中加上SetWindowPos(&wndTopMost,.....)祝你成功!
      

  2.   

    我是这样实现的,其中m_hWorklistDlg是我自建的对话框类句柄。调用成功了,可是m_hWorklistDlg对话框始终显示在系统的对话框之上,该如何是好。
    BOOL CWkLstSrvDlg::OnInitDialog()
    {
    m_hWorklistDlg = new CTestDlg;
    m_hWorklistDlg->Create(IDDW_WORKLIST_DLG,this);
    m_hWorklistDlg->SetWindowPos(NULL,
    0,
    0,
    800,
    600,
    SWP_SHOWWINDOW);
    CDialog::OnInitDialog(); // Set the icon for this dialog.  The framework does this automatically
    //  when the application's main window is not a dialog
    SetIcon(m_hIcon, TRUE); // Set big icon
    SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here

    return TRUE;  // return TRUE  unless you set the focus to a control
    }
      

  3.   

    用无模式对话框
    BOOL Create(LPCTSTR lpszTemlateName,CWnd * pParentWnd=NULL);
      

  4.   

    一个笨办法,主框架出来后隐藏,在主框架的app中动态创建一个非模式的,在主框架的oninitdialog中在生成一个模式的即可