What I need to know:
I would like to detect when a the main thread (process?) terminates so that I can ensure certain actions are performed before i
You should have an entry point for your application. Normally you can do there some logging when all tasks are terminated:
static void Main() { try { Application.Run( .... ); } finally { // logging ... } }