Click to See Complete Forum and Search --> : prompt for exit program


BinaryAnge
December 29th, 2002, 01:03 PM
my program prompts the user " Do you want to exit program?", which works fine except that it prompts when windows is closing. how do i test for windows closing to allow my program to exit without prompting. ( use to do it in query unload )

TheCPUWizard
December 29th, 2002, 01:31 PM
Set a flag in the explicit window close. Check the flag in QueryUnload....

BinaryAnge
December 29th, 2002, 01:59 PM
you're thinking of vb6. this is net. there is no query unload. thanks anyway.

Iouri
December 30th, 2002, 08:28 AM
"Closing" is the event which is running when form is closing.
Using the event arg e you can set e.Cancel = True
if you wish to cancel closing.

BinaryAnge
December 30th, 2002, 10:03 AM
thats not what i asked, i know how to use the e.cancel, what i want to know is how to test to see if my program is closing because the operating system is closing.

DSJ
December 30th, 2002, 10:44 AM
Check this thread
http://www.gotdotnet.com/Community/MessageBoard/Thread.aspx?id=40651

BinaryAnge
December 30th, 2002, 10:57 AM
that was exactly what i wanted. thanks.