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. Database & SysAdmin
  3. System Admin
  4. Trapping the Kill of a process in Task Manager

Trapping the Kill of a process in Task Manager

Scheduled Pinned Locked Moved System Admin
helpcsharpjson
6 Posts 6 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.
  • M Offline
    M Offline
    manivannan p
    wrote on last edited by
    #1

    Hi , I have a problem for which, I found no solution till now. Would be very happy if you could help me in this. This is in Windows OS. I have a C**# .NET** windows application running. I go to TaskManager and kill the process. Now, I want my application to be aware of this killing.I tried all the WIN API's and events too but nothing is fired back to the application. All these Closing and Handle destroying events are called only when I close the application. Please help me in finding a solution for the same. Thanks and Regards,

    T M Z V 4 Replies Last reply
    0
    • M manivannan p

      Hi , I have a problem for which, I found no solution till now. Would be very happy if you could help me in this. This is in Windows OS. I have a C**# .NET** windows application running. I go to TaskManager and kill the process. Now, I want my application to be aware of this killing.I tried all the WIN API's and events too but nothing is fired back to the application. All these Closing and Handle destroying events are called only when I close the application. Please help me in finding a solution for the same. Thanks and Regards,

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      just curious, but why would you like to avoid one to kill the process ? (is your code a virus like ? :-D )


      TOXCCT >>> GEII power
      [toxcct][VisualCalc]

      1 Reply Last reply
      0
      • M manivannan p

        Hi , I have a problem for which, I found no solution till now. Would be very happy if you could help me in this. This is in Windows OS. I have a C**# .NET** windows application running. I go to TaskManager and kill the process. Now, I want my application to be aware of this killing.I tried all the WIN API's and events too but nothing is fired back to the application. All these Closing and Handle destroying events are called only when I close the application. Please help me in finding a solution for the same. Thanks and Regards,

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        You can't. Killing a process means the OS unceremoniously rips it out of memory. If an app were hung, and the OS notified it that it was being killed, then what? The app is hung and can't respond. An app could also do all sorts of Bad Things in response (like a virus could run another copy of itself). --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ Strange things are afoot at the U+004B U+20DD

        1 Reply Last reply
        0
        • M manivannan p

          Hi , I have a problem for which, I found no solution till now. Would be very happy if you could help me in this. This is in Windows OS. I have a C**# .NET** windows application running. I go to TaskManager and kill the process. Now, I want my application to be aware of this killing.I tried all the WIN API's and events too but nothing is fired back to the application. All these Closing and Handle destroying events are called only when I close the application. Please help me in finding a solution for the same. Thanks and Regards,

          Z Offline
          Z Offline
          zildjohn01
          wrote on last edited by
          #4

          the best technique (and only technique :-D) for this i have seen is to run two processes, process_a.exe and process_b.exe In each create and open a handle of the other process, and wait for close notification of the other process, when you get that notify, just shell the process again. please dont send me a virus ;P [[[ sig goes here ]]]

          M 1 Reply Last reply
          0
          • Z zildjohn01

            the best technique (and only technique :-D) for this i have seen is to run two processes, process_a.exe and process_b.exe In each create and open a handle of the other process, and wait for close notification of the other process, when you get that notify, just shell the process again. please dont send me a virus ;P [[[ sig goes here ]]]

            M Offline
            M Offline
            munawar1968
            wrote on last edited by
            #5

            Most viruses these days seem to be using this technique... (Re.."In each create and open a handle of the other process, and wait for close notification of the other process, when you get that notify, just shell the process again." ) How can it be countered .. programmatically or otherwise? Any ideas?

            1 Reply Last reply
            0
            • M manivannan p

              Hi , I have a problem for which, I found no solution till now. Would be very happy if you could help me in this. This is in Windows OS. I have a C**# .NET** windows application running. I go to TaskManager and kill the process. Now, I want my application to be aware of this killing.I tried all the WIN API's and events too but nothing is fired back to the application. All these Closing and Handle destroying events are called only when I close the application. Please help me in finding a solution for the same. Thanks and Regards,

              V Offline
              V Offline
              Vasudevan Deepak Kumar
              wrote on last edited by
              #6

              Hi Manivannan: Itz by design. When you select 'End Process', did you go through the warning: "Terminating a process can cause undesirable results including loss of data and system instability. The process will not be given a chance to save its state or data before it is terminated. Are you sure you want to terminate the process?" Deepak Kumar Vasudevan Personal Web: http://vdeepakkumar.netfirms.com/ I Blog At: http://deepak.blogdrive.com/

              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