|
-
Oct 19th, 2003, 07:10 PM
#1
Thread Starter
Frenzied Member
Cannot close my program for shutdown
I have a program that uses the X(close) button in the right hand corner of the Form to make the Form invisible. I only want the program to exit from the Close event if windows is shutting down.
To check if windows is shutting down I override WndProc and check for the WM_ENDSESSION message. That part works perfecly and I set m.Result to (IntPtr)1. Which should allow Windows to continue shutting down. If 1 is wrong I also tried 0 with the same results.
The problem is that the program does not close and windows does not shut down. I am thinking that maybe the Close event is called before the ENDSESSION message is sent and that is why this is not working.
Does anyone have a solution to this problem?
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
|