467,166 Members | 1,099 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,166 developers. It's quick & easy.

possible Nube question about system messages - please help

Is there anyway to hold the base.WndProc(ref m) until after the Logout()
function finishes loading a webpage??

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, I don't believe that it is
waiting for the webpage to load.

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; //do i really want to shut down?
Logout();
break;

case WM_WTSSESSION_CHANGE:
this.flagBoolean1 = true; //do i really want to shut down?
Logout();
break;

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

the Logout() function consists of a call to a website.

my understanding of messages is not very good, and i haven't been able to
find a good way to learn about them.

Nov 17 '05 #1
  • viewed: 915
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by sugaray | last post: by
1 post views Thread by Thoraxx | last post: by
2 posts views Thread by Joshua Tan | last post: by
13 posts views Thread by Alison Givens | last post: by
9 posts views Thread by Wayne Smith | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.