-
January 7th, 2010, 06:08 AM
#1
Program to detect windows shut down
Hi,
I have an application and this application needs to close when the window shutdown happen. How can i detect that the system is shutting down from a C# program
-
January 7th, 2010, 06:17 AM
#2
Re: Program to detect windows shut down
if it is a windows application, use the FormClosing event
Code:
private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
if (e.CloseReason == CloseReason.WindowsShutDown) {
//
}
}
-
January 7th, 2010, 06:39 AM
#3
Re: Program to detect windows shut down
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|