I have a simple Form-Based .NET application. In this I capture the FormClosing Event to prevent the closing of the application, instead I minimize it. The application should always be open. Here is the code I use:
private void Browser_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = true;
}
The problem now is that this prevents the computer from shuting down for users with non-admin rights. Anything I can do so that the computer is able to shut down and the user can`t close the application?