Run an application when terminated in Taskmanager does anyone know this? when i terminate my program using task manager, it will run a program first before it will be killed
Have you tried this? Code: Private Sub Form1_FormClosed(sender As Object, e As FormClosedEventArgs) Process.Start("YOURPROCESSHERE") End Sub Make sure you use System.Diagnostics in your imports.
i dont believe this is possible because task manager just ends executinon it doesn't run through and tell the program it's exiting as in with the close button
If you have 2 applications running, and have one of them keep an eye out for the other then yes, its possible to do something similar, but to run a process just before its killed, I havent a clue. I know you can run a code from an app after a process its killed, if you are keeping tabs on it. Your main application must fire both threads on startup. I think I played with this a while back, I had a background process always checking for an application to be running.