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. Exit with confirmation

Exit with confirmation

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 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.
  • J Offline
    J Offline
    Jose Luis Sogorb
    wrote on last edited by
    #1

    I need to ask for confirmation when finishing an app, how can I process the messages sent by any way of closing an application? ("Exit" in File Menu, the cross at top-right in the window, or even using task manager) Thank you.

    C 1 Reply Last reply
    0
    • J Jose Luis Sogorb

      I need to ask for confirmation when finishing an app, how can I process the messages sent by any way of closing an application? ("Exit" in File Menu, the cross at top-right in the window, or even using task manager) Thank you.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Override ( from memory ) OnClose and only call the base method if your confirmation dialog returns in the affirmative. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
      C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
      It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003

      M 1 Reply Last reply
      0
      • C Christian Graus

        Override ( from memory ) OnClose and only call the base method if your confirmation dialog returns in the affirmative. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
        C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
        It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003

        M Offline
        M Offline
        Moak
        wrote on last edited by
        #3

        Hm. one question: how do you handle if application shuts down (user action) -or- windows shuts down? I mean, it isn't comfortable to show a dialog when system restarts.

        C 1 Reply Last reply
        0
        • M Moak

          Hm. one question: how do you handle if application shuts down (user action) -or- windows shuts down? I mean, it isn't comfortable to show a dialog when system restarts.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Well, in that case, what *can* you do ? If your app needs to confirm shutdown, it should do so always. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
          C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
          It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003

          J 1 Reply Last reply
          0
          • C Christian Graus

            Well, in that case, what *can* you do ? If your app needs to confirm shutdown, it should do so always. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
            C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
            It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003

            J Offline
            J Offline
            Jose Luis Sogorb
            wrote on last edited by
            #5

            Ok, that works, I've override onclose, and it's ok. And what about killing the process from task manager, is it possible to do the same? Thanks a lot.

            C 1 Reply Last reply
            0
            • J Jose Luis Sogorb

              Ok, that works, I've override onclose, and it's ok. And what about killing the process from task manager, is it possible to do the same? Thanks a lot.

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              If a process is killed, you get no say in what happens at all, it is simply stopped. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
              C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
              It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003

              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