This is a follow up to my initial question and I would like to present my findings and ask for corrections, ideas and insights. My findings (or rather interpretations) come
Just add a new event on your main form:
private void frmMain_Load(object sender, EventArgs e) { Application.ApplicationExit += new EventHandler(this.WhenItStopsDoThis); } private void WhenItStopsDoThis(object sender, EventArgs e) { //Program ended. Do something here. }