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. closing MFC dialog app

closing MFC dialog app

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++help
4 Posts 3 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.
  • V Offline
    V Offline
    viperlogic
    wrote on last edited by
    #1

    i have an app with a login dialog box, with login button, when the button is pressed the login dialog box hides and new dialog box opens. When i click cancel in the new main dialog box, the dialog box disappears but the app is still running in the background in taskmanager. is it becuase the login dialog box is hidden and not closed or ??? how do i close the hidden dialog box if that is the problem or is it summit else? regards keith void CKeithDlg::OnLogin() { ShowWindow(SW_HIDE); CMainDlg Dlg; Dlg.DoModal(); } ======================================== void CMainDlg::OnCancel() { CDialog::OnCancel(); }

    M M 2 Replies Last reply
    0
    • V viperlogic

      i have an app with a login dialog box, with login button, when the button is pressed the login dialog box hides and new dialog box opens. When i click cancel in the new main dialog box, the dialog box disappears but the app is still running in the background in taskmanager. is it becuase the login dialog box is hidden and not closed or ??? how do i close the hidden dialog box if that is the problem or is it summit else? regards keith void CKeithDlg::OnLogin() { ShowWindow(SW_HIDE); CMainDlg Dlg; Dlg.DoModal(); } ======================================== void CMainDlg::OnCancel() { CDialog::OnCancel(); }

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      CKeithDlg hides itself but doesn't close itself, so the app is running with a hidden main window. IIUC you want the app to exit after CMainDlg closes, right? At the end of CKeithDlg::OnLogin(), add EndDialog(IDOK); --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

      V 1 Reply Last reply
      0
      • M Michael Dunn

        CKeithDlg hides itself but doesn't close itself, so the app is running with a hidden main window. IIUC you want the app to exit after CMainDlg closes, right? At the end of CKeithDlg::OnLogin(), add EndDialog(IDOK); --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

        V Offline
        V Offline
        viperlogic
        wrote on last edited by
        #3

        thanks, that did it

        1 Reply Last reply
        0
        • V viperlogic

          i have an app with a login dialog box, with login button, when the button is pressed the login dialog box hides and new dialog box opens. When i click cancel in the new main dialog box, the dialog box disappears but the app is still running in the background in taskmanager. is it becuase the login dialog box is hidden and not closed or ??? how do i close the hidden dialog box if that is the problem or is it summit else? regards keith void CKeithDlg::OnLogin() { ShowWindow(SW_HIDE); CMainDlg Dlg; Dlg.DoModal(); } ======================================== void CMainDlg::OnCancel() { CDialog::OnCancel(); }

          M Offline
          M Offline
          MANISH RASTOGI
          wrote on last edited by
          #4

          void CKeithDlg::OnLogin() { ShowWindow(SW_HIDE); CMainDlg Dlg; Dlg.DoModal(); EndDialog(IDOK); } Manish Rastogi

          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