windows xp - C# system stopping tray application -


i have c# app starts @ system boot in tray, , have following problem it, on windows xp

i can't restart pc while application running. if use file > exit, stops ok , can restart. if try restarting application open, won't it

i tried adding in main window constructor, dunno if right thing do:

application.applicationexit += new eventhandler(this.onapplicationexit); 

and onapplicationexit function app's shutting down procedure.. doesn't help

any ideas?

do have formclosing event handler somewhere e.cancel = true;?

if so, change first @ close reason decide if should cancel or not as:

if(e.closereason != windowsshutdown)      e.cancel = true; 

there might other closereasons should not cancel closing might worth looking @ msdn that.


Comments

Popular posts from this blog

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -