我是这样实现的,其中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 }
2、用非模式对话框
在对话框的初始化函数中加上SetWindowPos(&wndTopMost,.....)祝你成功!
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
}
BOOL Create(LPCTSTR lpszTemlateName,CWnd * pParentWnd=NULL);