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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to Exit a Program

How to Exit a Program

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
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.
  • G Offline
    G Offline
    gmlnd
    wrote on last edited by
    #1

    I have a program,using a left menu of options, when the user click on the options to the left a new frame window opens up to the right. I want the exit button to close the program. The Exit button is located in the left menu, not in the main frame. I have used DestroyWindow(), but when I run the program and click on Exit the program crashes.

    C 1 Reply Last reply
    0
    • G gmlnd

      I have a program,using a left menu of options, when the user click on the options to the left a new frame window opens up to the right. I want the exit button to close the program. The Exit button is located in the left menu, not in the main frame. I have used DestroyWindow(), but when I run the program and click on Exit the program crashes.

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      try PostMessage(WM_QUIT)

      Chris Losinger
      Smaller Animals Software

      M 1 Reply Last reply
      0
      • C Chris Losinger

        try PostMessage(WM_QUIT)

        Chris Losinger
        Smaller Animals Software

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

        Or try the dirty way: exit(0);

        G 1 Reply Last reply
        0
        • M Mike24

          Or try the dirty way: exit(0);

          G Offline
          G Offline
          gmlnd
          wrote on last edited by
          #4

          Thanks.

          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