C# how to receive system close or exit events in a commandline application
15849
Capture console exit C#
5845
termination of program on main thread exit?
133300
How to asynchronously launch external program from cli and discard its output?
138192
How to read to end process output asynchronously in C#?
139524
How do I show a console output/window in a forms application?
88896
How to monitor a Windows process and send an alert when it crashes or closes?
154113
Detecting and restarting my crashed .NET application
60745
How do I exit a WPF application programmatically?
134966
Need a way to check status of Windows service programmatically
110750
Get Exitcodes from WindowsForms Application in command window
25090
How to get main window handle from process id?
95462
C# - How to detect a Windows shutdown/logoff and cancel that action (after asking the user)
148278
Is there any way to execute something when closing the laptop's lid?
30155
Interprocess communication for Windows in C# (.NET 2.0)
124639
How to get shutdown hook to execute on a process launched from Eclipse
94622
How does one extract a command's exit status into a variable?
65354
What is the Best Practice for Combating the Console Closing Issue?