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. Which is the simplest way to close an application?

Which is the simplest way to close an application?

Scheduled Pinned Locked Moved C / C++ / MFC
question
10 Posts 7 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
    julych
    wrote on last edited by
    #1

    Which is the simplest way to terminate a dialog-based application?

    P A P S R 5 Replies Last reply
    0
    • J julych

      Which is the simplest way to terminate a dialog-based application?

      P Offline
      P Offline
      Peter Molnar
      wrote on last edited by
      #2

      1.The simplest is: clicking on the close button on the right upper corner with the mouse. 2.Second simplest: DestroyWindow() (from your app); Peter Molnar

      J 1 Reply Last reply
      0
      • J julych

        Which is the simplest way to terminate a dialog-based application?

        A Offline
        A Offline
        alex barylski
        wrote on last edited by
        #3

        Click the the X??? :) The word of the day is legs, let's go back to my house and spread the word ;P

        J 1 Reply Last reply
        0
        • P Peter Molnar

          1.The simplest is: clicking on the close button on the right upper corner with the mouse. 2.Second simplest: DestroyWindow() (from your app); Peter Molnar

          J Offline
          J Offline
          julych
          wrote on last edited by
          #4

          :-))Sorry, I missed some words in my question - I meant how one application can terminate another one...

          L 1 Reply Last reply
          0
          • A alex barylski

            Click the the X??? :) The word of the day is legs, let's go back to my house and spread the word ;P

            J Offline
            J Offline
            julych
            wrote on last edited by
            #5

            O, really? Thanks!:-D:-D It's my mistake I didn't ask the right question - what I meant was how one application can terminate another one.

            A 1 Reply Last reply
            0
            • J julych

              Which is the simplest way to terminate a dialog-based application?

              P Offline
              P Offline
              Peak
              wrote on last edited by
              #6

              if you know the title of that window, use this: LPSTR name="the_window_title"; HWND hWnd = ::FindWindow(NULL,name); ::SendMessage(hWnd, WM_CLOSE, 0, 0);

              1 Reply Last reply
              0
              • J julych

                O, really? Thanks!:-D:-D It's my mistake I didn't ask the right question - what I meant was how one application can terminate another one.

                A Offline
                A Offline
                alex barylski
                wrote on last edited by
                #7

                I figured so...but the answer is fairly trivial, so I figured I'd just be a smart a$$ and let someone else tell you. Cheers :) The word of the day is legs, let's go back to my house and spread the word ;P

                1 Reply Last reply
                0
                • J julych

                  Which is the simplest way to terminate a dialog-based application?

                  S Offline
                  S Offline
                  Shehzad Salim
                  wrote on last edited by
                  #8

                  The best way is to send WM_CLOSE message at any time

                  1 Reply Last reply
                  0
                  • J julych

                    Which is the simplest way to terminate a dialog-based application?

                    R Offline
                    R Offline
                    rickfly70
                    wrote on last edited by
                    #9

                    AfxGetMainWnd()->PostMessage(WM_CLOSE, 0, 0); Fast. Riccardo.

                    1 Reply Last reply
                    0
                    • J julych

                      :-))Sorry, I missed some words in my question - I meant how one application can terminate another one...

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

                      send it a WM_CLOSE message


                      "there is no spoon"
                      biz stuff   about me

                      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