Is there an event or something I could catch that would tell me that my console app is being terminated? Like by Windows being shutdown, etc.

Thanks