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 determine if an .EXE is running?

How to determine if an .EXE is running?

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadmintutorialquestion
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.
  • T Offline
    T Offline
    TWilliams
    wrote on last edited by
    #1

    Hi, I have two identical computers on the network. The VC++ software I wrote can only be running on one of the machines at a time. Is there a way to enumerate or check the exe's running on the other computer. Thanks Tim :rolleyes:

    M V 2 Replies Last reply
    0
    • T TWilliams

      Hi, I have two identical computers on the network. The VC++ software I wrote can only be running on one of the machines at a time. Is there a way to enumerate or check the exe's running on the other computer. Thanks Tim :rolleyes:

      M Offline
      M Offline
      MarkyMark
      wrote on last edited by
      #2

      I don't think so. If you had a shared location they could both access you could create a file there though which would indicate the program was running.

      1 Reply Last reply
      0
      • T TWilliams

        Hi, I have two identical computers on the network. The VC++ software I wrote can only be running on one of the machines at a time. Is there a way to enumerate or check the exe's running on the other computer. Thanks Tim :rolleyes:

        V Offline
        V Offline
        valikac
        wrote on last edited by
        #3

        There are several solutions. One solution is COM in a local process would connect to the remote process. The remote process would update its status. A simpler solution is socket. Kuphryn

        T 1 Reply Last reply
        0
        • V valikac

          There are several solutions. One solution is COM in a local process would connect to the remote process. The remote process would update its status. A simpler solution is socket. Kuphryn

          T Offline
          T Offline
          TWilliams
          wrote on last edited by
          #4

          Thanks, I was trying to stay away from COM. I'm not that familiar with it. I thought about using a socket but I wasn't sure if windows had something already for this purpose. Tim :rolleyes:

          J I 2 Replies Last reply
          0
          • T TWilliams

            Thanks, I was trying to stay away from COM. I'm not that familiar with it. I thought about using a socket but I wasn't sure if windows had something already for this purpose. Tim :rolleyes:

            J Offline
            J Offline
            Joe Woodbury
            wrote on last edited by
            #5

            You could enumerate the processes on the other computer but that would require you have the proper [administrative] rights. It could also be unreliable if someone changed the name of the executable. See http://www.sysinternals.com/[^] for code on enumerating processes and other things. I think a simple socket idea is probably the best.

            1 Reply Last reply
            0
            • T TWilliams

              Thanks, I was trying to stay away from COM. I'm not that familiar with it. I thought about using a socket but I wasn't sure if windows had something already for this purpose. Tim :rolleyes:

              I Offline
              I Offline
              IceMatrix
              wrote on last edited by
              #6

              i have quite a good solution! use the CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, NULL ) to get a complete list of the running processes on the local machine... have a look at msdn under CreateToolhelp32Snapshot, you will find a useful code snippet there.

              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