Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dialog box not appearing in front of main window

Status
Not open for further replies.

drizet

Programmer
Mar 26, 2001
6
US
I have created a dialog based application with a menubar. The menubar selection pops up another dialog box. But, this one appears very breifly then disappears behind the maindialog app window. How can I make it stay in front of the parent window? In the properties, I have made sure I have checked visible for the dialog. Below is the code I use:

Call from menubar callback:

void CPrf_plotDlg::OnUserCommandPrfPlot(long wParam, long lParam, short FAR* nRes)
{
CPrf_txtDataDlg myTextDlg;
//char m_str[80];

//sprintf(m_str,"%ld\n", wParam);

// MessageBox(m_str, "User Command:", MB_OK);

// TODO: Add your control notification handler code here
switch (wParam)
{
case 4:
break;
case 5:
case 6:
case 7:
case 8:
case 9: myTextDlg.OpenWindow();
break;
default: fprintf(stderr,"Invalid user command\n");
}


}

The procedure used to create the dialog box:

void CPrf_txtDataDlg::OpenWindow()
{
// open receive dialog
Create (IDD_TEXT_DATA_DLG, NULL);
ShowWindow (SW_SHOW);
}

Thanks for any help.

Scott Urban
Sr. Software Engineer
Lockheed Martin Astronautics
 
use stile of box MB_SYSTEMMODAL.
You can also use MB_APPLMODAL, but in this case the parent of box should be your application window. John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top