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 close .exe file in process list in task manager

how to close .exe file in process list in task manager

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

    Hi there, I am working on an application that checks the task manager process list and if more than one copy of an .exe file is running, it could close them all and restart it again so that just one copy be running. I could do the part that if one specified application is closing, my program can restart it but I have problem when multiple (the same application) .exe file run sometimes and makes trouble for me. Any help would be appreciated, Regards, Nahitan

    D M S H 4 Replies Last reply
    0
    • N nahitan

      Hi there, I am working on an application that checks the task manager process list and if more than one copy of an .exe file is running, it could close them all and restart it again so that just one copy be running. I could do the part that if one specified application is closing, my program can restart it but I have problem when multiple (the same application) .exe file run sometimes and makes trouble for me. Any help would be appreciated, Regards, Nahitan

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

      So why not be proactive rather than reactive? In other words, why not just disallow multiple instance to begin with?


      "A good athlete is the result of a good and worthy opponent." - David Crow

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      1 Reply Last reply
      0
      • N nahitan

        Hi there, I am working on an application that checks the task manager process list and if more than one copy of an .exe file is running, it could close them all and restart it again so that just one copy be running. I could do the part that if one specified application is closing, my program can restart it but I have problem when multiple (the same application) .exe file run sometimes and makes trouble for me. Any help would be appreciated, Regards, Nahitan

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        And if an application closes all other instances of itself, how could there ever be multiple instances of itself? :)

        "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

        N 1 Reply Last reply
        0
        • N nahitan

          Hi there, I am working on an application that checks the task manager process list and if more than one copy of an .exe file is running, it could close them all and restart it again so that just one copy be running. I could do the part that if one specified application is closing, my program can restart it but I have problem when multiple (the same application) .exe file run sometimes and makes trouble for me. Any help would be appreciated, Regards, Nahitan

          S Offline
          S Offline
          swarup
          wrote on last edited by
          #4

          see ma frnd there are many ways to do that, but what is ur req, one way u can query the process list of system to find the instance, 2nd u can setup a hook to taskman or read the taskman list get the pid and kill it, let me knw, i wil give u the code, i will try not promise

          N 1 Reply Last reply
          0
          • M Mark Salsbery

            And if an application closes all other instances of itself, how could there ever be multiple instances of itself? :)

            "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

            N Offline
            N Offline
            nahitan
            wrote on last edited by
            #5

            the problem is that when customer in some circomstances closes the application by clicking on x, the application looks like to be oppened but it is still running in process list and when they attempt to reopen the appplication, two would be running and so on. the problem is that this just happen sometimes and not all the time. I could not be able to duplicate the problem in my work station and can not understand what really happens. Regards,

            1 Reply Last reply
            0
            • S swarup

              see ma frnd there are many ways to do that, but what is ur req, one way u can query the process list of system to find the instance, 2nd u can setup a hook to taskman or read the taskman list get the pid and kill it, let me knw, i wil give u the code, i will try not promise

              N Offline
              N Offline
              nahitan
              wrote on last edited by
              #6

              thanks for the help I think it is good to check the task manager's process list and if multiple copy of the program are running kill it and reopen it. regards,

              1 Reply Last reply
              0
              • N nahitan

                Hi there, I am working on an application that checks the task manager process list and if more than one copy of an .exe file is running, it could close them all and restart it again so that just one copy be running. I could do the part that if one specified application is closing, my program can restart it but I have problem when multiple (the same application) .exe file run sometimes and makes trouble for me. Any help would be appreciated, Regards, Nahitan

                H Offline
                H Offline
                Hamid Taebi
                wrote on last edited by
                #7

                You said you check for does your program is exist or no I think some days ago I saw a thread on the codeproject about this search on the comments for see this thread.:)


                WhiteSky


                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