Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Pop Dialog before start

Pop Dialog before start

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Richard Cheng
    wrote on last edited by
    #1

    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.

    A L 3 Replies Last reply
    0
    • R Richard Cheng

      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.

      A Offline
      A Offline
      AlexMarbus
      wrote on last edited by
      #2

      EndDialog(IDOK)www.marbus.net
      But then again, I could be wrong.

      1 Reply Last reply
      0
      • R Richard Cheng

        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.

        A Offline
        A Offline
        AlexMarbus
        wrote on last edited by
        #3

        EndDialog(IDOK)www.marbus.net
        But then again, I could be wrong.

        R 1 Reply Last reply
        0
        • A AlexMarbus

          EndDialog(IDOK)www.marbus.net
          But then again, I could be wrong.

          R Offline
          R Offline
          Richard Cheng
          wrote on last edited by
          #4

          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?

          M A 2 Replies Last reply
          0
          • R Richard Cheng

            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.

            L Offline
            L Offline
            l a u r e n
            wrote on last edited by
            #5

            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"

            1 Reply Last reply
            0
            • R Richard Cheng

              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?

              M Offline
              M Offline
              Manfred Ramosch
              wrote on last edited by
              #6

              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...

              1 Reply Last reply
              0
              • R Richard Cheng

                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?

                A Offline
                A Offline
                Andreas Masur
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups