473,498 Members | 1,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows shutdown trigger event in VB.NET App?

Hi all,

I have a fairly simple VB.Net app in which I capture some data when the user
exits the application the "normal" way. However, I still want to capture the
same data when the application is closed when Windows shuts down, and in the
unlikely event that someone uses the Task Manager to end my process.

I am using a hidden form as the base with a system tray icon, so the
application doesn't sit in the taskbar and there is not usually a visible
form. When the user exits the app, they right click on the system tray icon
and select a menu command.

I am fairly new to .NET, so be gentle. :-)

TIA and have a great day!

--
Stephen Lang
Legislative Counsel Bureau
Carson City, NV
GMT+8
slang at lcb <dot> state <dot2> nv <dot3> us
Nov 21 '05 #1
2 3288
"Steve Lang" <no*****@Nohow.not> schrieb:
I have a fairly simple VB.Net app in which I capture some data when the
user exits the application the "normal" way. However, I still want to
capture the same data when the application is closed when Windows shuts
down, and in the unlikely event that someone uses the Task Manager to end
my process.


See:

<URL:http://web.archive.org/web/20041113033054/http://fawcette.com/archives/premier/mgznarch/vbpj/2001/11nov01/qa0111/qa0111.asp>

In addition to that, check out the 'SystemEvents' class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
Thanks Herfried.

I'll look it over and if I have problems, rest assured I won't hesitate to
ask the groupmind...

Steve
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:Os**************@TK2MSFTNGP12.phx.gbl...
"Steve Lang" <no*****@Nohow.not> schrieb:
I have a fairly simple VB.Net app in which I capture some data when the
user exits the application the "normal" way. However, I still want to
capture the same data when the application is closed when Windows shuts
down, and in the unlikely event that someone uses the Task Manager to end
my process.


See:

<URL:http://web.archive.org/web/20041113033054/http://fawcette.com/archives/premier/mgznarch/vbpj/2001/11nov01/qa0111/qa0111.asp>

In addition to that, check out the 'SystemEvents' class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

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

Similar topics

4
7104
by: Bill Sonia | last post by:
I'm written a Windows Service to send e-mails on events like OnStart, OnStop, OnShutDown using System.Web.Mail. It works for everything but OnShutdown. My guess is that once my send mail code is...
8
4159
by: Bill Sonia | last post by:
I've written a Windows Service to send e-mails on events like OnStart, OnStop, OnShutDown using System.Web.Mail. It works for everything but OnShutdown. My guess is that for OnShutDown, once my...
7
7850
by: Nikki | last post by:
Hi, Can anybody help me, i want to prevent windows to close my winform of ..NET application, when user presses Alt+F4
6
8735
by: carbon_dragon | last post by:
Ok, so here is the problem. I'm working on a headless server program implemented as a .NET C# Console project. There is a UPS mounted to this server (though not a windows compliant UPS). I can only...
2
4088
by: Peter Meinl | last post by:
Restarting Windows seems not to fire the OnShutdown event in the Windows Service. Does not work on Windows XP SP2 and not on Windows 2003 Server SP1. OnStart and OnStop do work fine. Steps...
0
2115
by: Stefan Krah | last post by:
Hello, I'm trying to run a Python script as a Windows service with a defined shutdown. The script (enigma-client.py) handles the communications with the server in a distributed computing effort...
4
3396
by: Markus Stoeger | last post by:
Hi, I have a problem with Application.Run() when Windows is shutting down. Please have a look at the copy&paste example program below. The application has no forms. It has only got a notify...
2
1337
by: Frank Rizzo | last post by:
I have a windows service which spawns a lot of threads that are all busy doing various things. What is the preferred way of telling all these threads to stop? For a situation, when the user stops...
3
5212
by: Benry | last post by:
Without having a reference to a specific folder, is there a way that Windows fires an event when files in a folder are modified? I'm using C++.NET 2.0 for programming a service, and would like...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7200
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...
1
6884
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...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4586
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...
0
1416
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 ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.