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#
  4. preventing being closed from task manager [modified]

preventing being closed from task manager [modified]

Scheduled Pinned Locked Moved C#
question
12 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.
  • E erfi

    i have a program that uses a process in background for some calculations. is there a way to prevent the process from being closed from task manager? just like antivirus programs that prevent their processes from being closed.

    sometimes 0 can be 1

    modified on Monday, February 9, 2009 4:23 PM

    D Offline
    D Offline
    Dave Kreskowiak
    wrote on last edited by
    #3

    That's been asked and answered about a hundred times around here. No, you can't do that with a user application. You can only do that with a Windows Service, but only under certain circumstances.

    A guide to posting questions on CodeProject[^]
    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
         2006, 2007, 2008

    1 Reply Last reply
    0
    • D DaveyM69

      Noone here is going to tell you how to do that. There is no valid use for it. Any application can potentially become unstable, even if programmed perfectly, and the user MUST be able to close it.

      Dave
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
      Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

      E Offline
      E Offline
      erfi
      wrote on last edited by
      #4

      of course there must be a way to close the process but i want it to be from the program

      sometimes 0 can be 1

      D 1 Reply Last reply
      0
      • E erfi

        i have a program that uses a process in background for some calculations. is there a way to prevent the process from being closed from task manager? just like antivirus programs that prevent their processes from being closed.

        sometimes 0 can be 1

        modified on Monday, February 9, 2009 4:23 PM

        D Offline
        D Offline
        Dan Neely
        wrote on last edited by
        #5

        Noone is going to tell you how to do something that is most likely to be used in writing malware.

        Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall

        E 1 Reply Last reply
        0
        • E erfi

          of course there must be a way to close the process but i want it to be from the program

          sometimes 0 can be 1

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #6

          What if the program hangs?... It's interesting for academic study only, but no use in the real world to 'end user friendly' developers so give it up.

          Dave
          BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
          Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

          1 Reply Last reply
          0
          • D Dan Neely

            Noone is going to tell you how to do something that is most likely to be used in writing malware.

            Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall

            E Offline
            E Offline
            erfi
            wrote on last edited by
            #7

            there is no need for this option to write a malware. approximately 99% of malwares todays are attaches to windows processes and you can't find them in process list

            1 Reply Last reply
            0
            • E erfi

              i have a program that uses a process in background for some calculations. is there a way to prevent the process from being closed from task manager? just like antivirus programs that prevent their processes from being closed.

              sometimes 0 can be 1

              modified on Monday, February 9, 2009 4:23 PM

              E Offline
              E Offline
              erfi
              wrote on last edited by
              #8

              i don't understand why some people read the messages just to give unrelated answers. this is a message board and someone asks a question and some people answer to it if the want to. so i f you don't know the answer or don't want to answer just don't do it. noone is going to judge you

              sometimes 0 can be 1

              C 1 Reply Last reply
              0
              • E erfi

                i don't understand why some people read the messages just to give unrelated answers. this is a message board and someone asks a question and some people answer to it if the want to. so i f you don't know the answer or don't want to answer just don't do it. noone is going to judge you

                sometimes 0 can be 1

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #9

                The only possible answer is to have another process running which checks if your first process was stopped, and restarts it. There is no way to do this, that cannot be defeated. A service can be set to restart itself, as someone else said.

                Christian Graus Driven to the arms of OSX by Vista.

                E 1 Reply Last reply
                0
                • E erfi

                  i have a program that uses a process in background for some calculations. is there a way to prevent the process from being closed from task manager? just like antivirus programs that prevent their processes from being closed.

                  sometimes 0 can be 1

                  modified on Monday, February 9, 2009 4:23 PM

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #10

                  Even AV shouldn't do this. Nor FireWalls either. ZoneAlarm crashed on me a couple of time (the bloody TrueVector thing) and it's impossible to do anything but reboot. If you want to use the internet, that is. And who doesn't? So after 3 such crashes I got angry and swore never to let that piece of crap get on any of my computers again. And I'm telling it to anyone who wants to hear it (or not). Would you like people to do that with your program?

                  1 Reply Last reply
                  0
                  • E erfi

                    i have a program that uses a process in background for some calculations. is there a way to prevent the process from being closed from task manager? just like antivirus programs that prevent their processes from being closed.

                    sometimes 0 can be 1

                    modified on Monday, February 9, 2009 4:23 PM

                    P Offline
                    P Offline
                    PIEBALDconsult
                    wrote on last edited by
                    #11

                    It can't be done. And it shouldn't be done. Anyway, I kill antivirus from task manager all the time.

                    1 Reply Last reply
                    0
                    • C Christian Graus

                      The only possible answer is to have another process running which checks if your first process was stopped, and restarts it. There is no way to do this, that cannot be defeated. A service can be set to restart itself, as someone else said.

                      Christian Graus Driven to the arms of OSX by Vista.

                      E Offline
                      E Offline
                      erfi
                      wrote on last edited by
                      #12

                      thank you Christian. that helped

                      sometimes 0 can be 1

                      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