G
Guest
Thanks in advance...
I have a windows forms c#.NET app that runs in the system tray; I'm
experiencing intermitent problems with when the end-user goes to Log Off,
Shutdown, etc...
For the most part the app always closes on these events but, there are times
when the user has to reselect the Log Off, Shutdown, etc button. It's almost
as if their shutdown process was terminated...
Again, this is an intermitent problem. Below is code I use in the
application to determine when the users session is ending so that way I can
close the app down...
private int _wm_QueryEndSession = 0x11;
protected override void WndProc(ref Message m)
{
try
{
if(m.Msg == this._wm_QueryEndSession)
{
Application.Exit();
}
base.WndProc(ref m);
}
catch(Exception ex)
{
Helper.writeEvent(ex,System.Diagnostics.EventLogEntryType.Error);
}
}
Am I missing something or is there a sure fire way to kill the app and
ensure the user is able to shutdown properly everytime..??
Any help would be great..!
I have a windows forms c#.NET app that runs in the system tray; I'm
experiencing intermitent problems with when the end-user goes to Log Off,
Shutdown, etc...
For the most part the app always closes on these events but, there are times
when the user has to reselect the Log Off, Shutdown, etc button. It's almost
as if their shutdown process was terminated...
Again, this is an intermitent problem. Below is code I use in the
application to determine when the users session is ending so that way I can
close the app down...
private int _wm_QueryEndSession = 0x11;
protected override void WndProc(ref Message m)
{
try
{
if(m.Msg == this._wm_QueryEndSession)
{
Application.Exit();
}
base.WndProc(ref m);
}
catch(Exception ex)
{
Helper.writeEvent(ex,System.Diagnostics.EventLogEntryType.Error);
}
}
Am I missing something or is there a sure fire way to kill the app and
ensure the user is able to shutdown properly everytime..??
Any help would be great..!