Pop Dialog before start
-
Hi, Does anyone know how to do the following things when launching the MFC program? First, start with a Dialog with no title bar, no menu, no button....nothing.....just a picture on it. Second, hold this dialog for awhile.....let say 5 seconds. Third, close automatically. Finally, start the MFC program. I know how to pop the dialog (DoModal()) and how to wait for 5 seconds...but i don't know how to close the dialog, and how to do it before the program start. It just likes Internet Explorer...when we launch IE, then it pop a little box...."Internet Explorer 5.0...." then start IE...right? Thanks.
-
Hi, Does anyone know how to do the following things when launching the MFC program? First, start with a Dialog with no title bar, no menu, no button....nothing.....just a picture on it. Second, hold this dialog for awhile.....let say 5 seconds. Third, close automatically. Finally, start the MFC program. I know how to pop the dialog (DoModal()) and how to wait for 5 seconds...but i don't know how to close the dialog, and how to do it before the program start. It just likes Internet Explorer...when we launch IE, then it pop a little box...."Internet Explorer 5.0...." then start IE...right? Thanks.
EndDialog(IDOK)www.marbus.net
But then again, I could be wrong. -
Hi, Does anyone know how to do the following things when launching the MFC program? First, start with a Dialog with no title bar, no menu, no button....nothing.....just a picture on it. Second, hold this dialog for awhile.....let say 5 seconds. Third, close automatically. Finally, start the MFC program. I know how to pop the dialog (DoModal()) and how to wait for 5 seconds...but i don't know how to close the dialog, and how to do it before the program start. It just likes Internet Explorer...when we launch IE, then it pop a little box...."Internet Explorer 5.0...." then start IE...right? Thanks.
EndDialog(IDOK)www.marbus.net
But then again, I could be wrong. -
EndDialog(IDOK)www.marbus.net
But then again, I could be wrong.Still don't know how to do...because when i use DoModal() to pop up the dialog, it waits for the user to click "OK or...." but now i won't use button in here and want to use code to make it close.......now my code is: CxxxDlg xxdlg; xxdlg.DoModal(); xxxx //make 10 seconds wait... xxdlg.EndDialog(IDOK); seems doesn't work....how to fix it?
-
Hi, Does anyone know how to do the following things when launching the MFC program? First, start with a Dialog with no title bar, no menu, no button....nothing.....just a picture on it. Second, hold this dialog for awhile.....let say 5 seconds. Third, close automatically. Finally, start the MFC program. I know how to pop the dialog (DoModal()) and how to wait for 5 seconds...but i don't know how to close the dialog, and how to do it before the program start. It just likes Internet Explorer...when we launch IE, then it pop a little box...."Internet Explorer 5.0...." then start IE...right? Thanks.
as alex said ... what you are describing is a splash screen pj has a good implementation on this site somewhere go check it out :) --- "every year we invent better idiot proof systems and every year they invent better idiots"
-
Still don't know how to do...because when i use DoModal() to pop up the dialog, it waits for the user to click "OK or...." but now i won't use button in here and want to use code to make it close.......now my code is: CxxxDlg xxdlg; xxdlg.DoModal(); xxxx //make 10 seconds wait... xxdlg.EndDialog(IDOK); seems doesn't work....how to fix it?
Just put up a timer
SetTimer(1, 7000, NULL); // for 7000ms == 7sec
and when WM_TIMER (after 7sec) is called by the framework, just set your
void MyDialog::OnTimer(UINT nIDEvent)
{
if(nIDEvent == 1)
{
KillTimer(1);
MyDlg.EndDialog(IDOK);
}
}I guess, that's what you wanted to know... Manfred --- Programming is knowing...
-
Still don't know how to do...because when i use DoModal() to pop up the dialog, it waits for the user to click "OK or...." but now i won't use button in here and want to use code to make it close.......now my code is: CxxxDlg xxdlg; xxdlg.DoModal(); xxxx //make 10 seconds wait... xxdlg.EndDialog(IDOK); seems doesn't work....how to fix it?
Do the following: CYourApp::InitInstance() { . . . // Call your first dialog FirstDialog::DoModal(); // Call your main dialog MainDialog::DoModal(); . . . } CFirstDialog::OnInitInstance() { // Do initialization stuff // Set timer SetTimer(1, 10000, NULL); return TRUE; } CFirstDialog::OnTimer(UINT nIDEvent) { if(nIDEvent == 1) { KillTimer(1); EndDialog(IDOK); } } This should display your splash screen for ten seconds before it loads the main dialog.