Click to See Complete Forum and Search --> : [RESOLVED] Problem with hidden app


foamy
November 20th, 2008, 05:38 AM
Hi guys,

I recently made an application which is hidden most of the time, during which it is represented by a tray-icon (NotifyIcon).
The app runs well and users are happy. Right up until it's time to shut down the computer. XP users complain that the app will make shutdown of their machine impossible until the process is killed.
I think this is because I have handled the main form's FormClosing event to allow a "close-to-tray" function. In Vista, this isn't a problem, but XP doesn't seem to handle it very well.

My question to you: is there a way I can check whether the computer is shutting down from my FormClosing eventhandler?

Thread1
November 20th, 2008, 06:20 AM
private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
if (e.CloseReason == CloseReason.WindowsSjutDown) {
}
}

foamy
November 20th, 2008, 07:00 AM
I just found that solution in another forum too :D
Resolved, thanks! ;)