In my windows application I have a Close button. While click on this it will call a function .
private void btClose_Click(object sender, EventArgs e)
{
EndFormalities();
}
Is it possible to call the EndFormalities() function, while closing this application through Task manager . Any predefined Events available in Windows.NET ?