473,621 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

system shut down problem with webbrowser

Is there anyway to hold the base.WndProc(re f 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(re f 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(re f 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(re f 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_QUERYENDSESS ION:
this.flagBoolea n1 = true; //do i really want to shut down?
Logout();
break;

case WM_WTSSESSION_C HANGE:
this.flagBoolea n1 = true; //do i really want to shut down?
Logout();
break;

}
base.WndProc(re f 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
1 2117
Mike,

I don't think it should really matter where you place it, because
windows is going to wait for your method to return, and calling the base at
any point isn't going to force the return.

Rather, I would look at the Logout function. Is it loading the page
asynchronously? If so, have it take a flag as a parameter which causes it
to load synchronously, or wait after the call to Logout (through an Event or
something of that nature) to determine when the page is done loading.

Also, what are you using to load the page?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"mikelostca use" <mi***********@ discussions.mic rosoft.com> wrote in message
news:11******** *************** ***********@mic rosoft.com...
Is there anyway to hold the base.WndProc(re f 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(re f 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(re f 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(re f 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_QUERYENDSESS ION:
this.flagBoolea n1 = true; //do i really want to shut
down?
Logout();
break;

case WM_WTSSESSION_C HANGE:
this.flagBoolea n1 = true; //do i really want to shut
down?
Logout();
break;

}
base.WndProc(re f 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 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6611
by: Nicolas Poirier | last post by:
I successfully made a system tray application. When I do shut down the computer, how does the computer can instruct my application to shut down? For the moment, if I don't quit my application, system asks to kill an unresponsive task before shut sown. How does I make shut down run more correctly? Thank you Nicolas Poirier
1
3789
by: Daniel | last post by:
System.IO.StreamWriter Close or Flush method to shut down the computer in such a way that just part of the file is written? or an empty file is written? Also if the Close or Flush is to a streamwriter writing to a network share, is it possible for the network to go down in such a way that the tartet file is only partialy written? or are there some kind of check sums to prevent this.
8
3138
by: John Baker | last post by:
Hi: I am URGENTLY in need of some book or web site OR tool that will help me integrate a relatively simple access application into a web page or pages. This is a time recording system (by project), and I would be more than wiling to pull the updated database down from the Host using FTP on a monthly basis. Its just that I need to understand how to set it up on the web site itself. The Host supports SQL. Any direction you can give would...
0
1129
by: mikelostcause | last post by:
Is there anyway to hold the base.WndProc(ref m) until after the Logout() 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...
0
1078
by: mikelostcause | last post by:
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)...
3
1582
by: BrianDH | last post by:
Hi I have a VB.Net windows application that for some reason when running will not allow the user to shut-down/reboot the Operating System without first closing my application. Has anyone had the problem and how might I resolve it? I need my app to allow the user to shut-down and or reboot their OS without closing my application first. Thanks
2
1278
by: vna | last post by:
Hello Everyone, Please send me the code for a system to automatically shutting down the system by specifying the time.Can use either C# or ASP.Net. Please help me asap. Regards, Vna
0
1090
by: Sidney | last post by:
Dear, I am writting a system which opened at the system tray. But every before I shut down my computer, I have to close the system first. However, it should be automatically close when I shutting down my system. So, I want to know how I can do so that it can close up itself when the computer shut down. Thank You!! Sidney
2
3510
by: EDPB | last post by:
Hey! I simply want to run multiple system $someprogram commands without having to wait for the previous program to shut down before the next one is opened.. e..g sub startMyProgs { system $startProgram1; system $startProgram2;
0
8213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8156
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8597
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8306
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5554
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4065
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2587
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.