I have a WinForm application, and when it's open and I try to restart my computer, my computer just hangs and doesn't restart. I have to actually close the WinForm app, and then restart, and my computer restarts.
What can I do to solve this?
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (!BoolShouldThisClose)
{
e.Cancel = true;
this.Visible = false;
}
}