Problems Shutting down a Sys Tray app

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm working on shutting down an app that runs in the system tray, I have no
problems shutting down, but I have problems saving data first.

if the base.WndProc(ref m) is placed at the top, it closes, but the system
does not continue to shutdown and it does not save the data via the Logout()
funtion.
If the base.WndProc(ref m) is placed at the bottom, it closes correctly, but
doesn't seem to perform the Logout function.

protected override void WndProc(ref Message m)
{
//base.WndProc(ref m); ----------placed at the top position
switch(m.Msg)
{
case WM_SYSCOMMAND:

switch(m.WParam.ToInt32()){

case SC_SCREENSAVE:
Logout();
break;

case SC_MONITORPOWER:
Logout();
break;

default:
break;
}
break;

case WM_QUERYENDSESSION:
this.flagBoolean1 = true;
Logout();
break;

case WM_WTSSESSION_CHANGE:
this.flagBoolean1 = true;
Logout();
break;

}
base.WndProc(ref m); ----------placed at the bottom position
}

the Logout() function consists of a call to a website.
 
Is there anyway to hold the base.WndProc(ref m) until after the Logout()
finishes loading the webpage?? any takers??
 
Back
Top