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. How to know when calling app exited/stopped

How to know when calling app exited/stopped

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
4 Posts 4 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.
  • R Offline
    R Offline
    Rostfrei
    wrote on last edited by
    #1

    I have a little application called updater.exe. This updater gets called by the other application called someapp.exe. Updater receives three arguments 1. calling application (full path of someapp.exe) 2. location of the installer file 3. installing destination folder So when someapp.exe calls updater.exe it immediately exits (it will get overwritten). Because this exiting process isn't instant, updater should check if it's still "alive". How can I do this? Can I get some handle from 1st argument and check if application is still running? Best regards,

    Rostfrei

    P J S 3 Replies Last reply
    0
    • R Rostfrei

      I have a little application called updater.exe. This updater gets called by the other application called someapp.exe. Updater receives three arguments 1. calling application (full path of someapp.exe) 2. location of the installer file 3. installing destination folder So when someapp.exe calls updater.exe it immediately exits (it will get overwritten). Because this exiting process isn't instant, updater should check if it's still "alive". How can I do this? Can I get some handle from 1st argument and check if application is still running? Best regards,

      Rostfrei

      P Offline
      P Offline
      Paresh Chitte
      wrote on last edited by
      #2

      Will this[^] helpful ? Regards, Paresh.

      1 Reply Last reply
      0
      • R Rostfrei

        I have a little application called updater.exe. This updater gets called by the other application called someapp.exe. Updater receives three arguments 1. calling application (full path of someapp.exe) 2. location of the installer file 3. installing destination folder So when someapp.exe calls updater.exe it immediately exits (it will get overwritten). Because this exiting process isn't instant, updater should check if it's still "alive". How can I do this? Can I get some handle from 1st argument and check if application is still running? Best regards,

        Rostfrei

        J Offline
        J Offline
        jhwurmbach
        wrote on last edited by
        #3

        You could use a kernel object, as describes by Christian Graus here[^].


        Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal.
        George Orwell, "Keep the Aspidistra Flying", Opening words

        1 Reply Last reply
        0
        • R Rostfrei

          I have a little application called updater.exe. This updater gets called by the other application called someapp.exe. Updater receives three arguments 1. calling application (full path of someapp.exe) 2. location of the installer file 3. installing destination folder So when someapp.exe calls updater.exe it immediately exits (it will get overwritten). Because this exiting process isn't instant, updater should check if it's still "alive". How can I do this? Can I get some handle from 1st argument and check if application is still running? Best regards,

          Rostfrei

          S Offline
          S Offline
          Stephen Hewitt
          wrote on last edited by
          #4

          Have the calling process pass a HANDLE to itself to the callee. Make sure this HANDLE is inheritable and then when you call CreateProcess to create the callee ensure the bInheritHandles argument is set to TRUE. The callee can then call WaitForSingleObject passing in this HANDLE to wait until the caller has exited.

          Steve

          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