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. stopping an exe

stopping an exe

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

    Hi there, I have in my application a button that launches another application such as the on-screen keyboard using the createprocess function. If the button is pressed again I want to close the application. How can I do this safely? Many thanks Jim

    D S 2 Replies Last reply
    0
    • J jimjim733

      Hi there, I have in my application a button that launches another application such as the on-screen keyboard using the createprocess function. If the button is pressed again I want to close the application. How can I do this safely? Many thanks Jim

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      jimjim733 wrote:

      If the button is pressed again I want to close the application. How can I do this safely?

      By calling ExitProcess().

      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      I 1 Reply Last reply
      0
      • J jimjim733

        Hi there, I have in my application a button that launches another application such as the on-screen keyboard using the createprocess function. If the button is pressed again I want to close the application. How can I do this safely? Many thanks Jim

        S Offline
        S Offline
        Stuart Dootson
        wrote on last edited by
        #3

        jimjim733 wrote:

        safely

        Define what you mean by 'safe' - that'll help indicate what an appropriate solution is.

        Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

        1 Reply Last reply
        0
        • D David Crow

          jimjim733 wrote:

          If the button is pressed again I want to close the application. How can I do this safely?

          By calling ExitProcess().

          "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          I Offline
          I Offline
          I am BATMAN
          wrote on last edited by
          #4

          Or if you want to kill the new application from the one that spawned it, use TerminateProcess().

          D 1 Reply Last reply
          0
          • I I am BATMAN

            Or if you want to kill the new application from the one that spawned it, use TerminateProcess().

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            I am BATMAN wrote:

            ...use TerminateProcess().

            Which is unsafe.

            "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            CPalliniC 1 Reply Last reply
            0
            • D David Crow

              I am BATMAN wrote:

              ...use TerminateProcess().

              Which is unsafe.

              "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #6

              I suppose Batman isn't expected to terminate gracefully a process... :rolleyes:

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              In testa che avete, signor di Ceprano?

              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