473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to tell if machine shutting down.

I have a program that sits in the system tray and spawns off a number of sub
processes.

For some reason, when this is running on a system, Windows will not shutdown
without manually shutting it down.

Is there some way within my code that I can pick up that Windows wants to
shut down and then do an orderly shutdown of the processes?

Thanks in advance
Simon
Nov 21 '05 #1
2 1036
"Simon Verona" <ne**@aphroditeuk.com> schrieb:
Is there some way within my code that I can pick up that Windows wants to
shut down and then do an orderly shutdown of the processes?


Handle 'SystemEvents.SessionEnding'.

--
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 K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
"Simon Verona" <ne**@aphroditeuk.com> schrieb:
Is there some way within my code that I can pick up that Windows wants to
shut down and then do an orderly shutdown of the processes?


Handle 'SystemEvents.SessionEnding'.

--
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

10
by: Jesper | last post by:
Does anyone know some c++ code for shutting down windows? I want to write a program using borland c++ builder to shut down windows. --
1
by: Phoenix | last post by:
Is there any way to disable being able to shut down a program totally? I would have to allow it to be closed when the computer is shutting down or the user is logging out, but other than that it...
3
by: kuldeep | last post by:
Hi all, I have a application developed in C# .net. The problem I face is I am unable to shutdown my machine when the exe is running. Windows is unable to close this exe an shut down. Can anyone...
1
by: mikelostcause | last post by:
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...
2
by: Mike Stephens | last post by:
I have an application to minimizes when X is clicked. If the user wants to close the application they click the Exit Application button.This works fine and does exactly what I need. I have since...
4
by: Eddie | last post by:
Hi All, In my application, every time the user "Close" the form, I cancel the close and I put a NotifyIcon in the systray. Here is my code : Private myForm_Closing(... ... ...) Handels...
3
by: leocwh | last post by:
Dear all, I would like to know how to run the execuatable before windows shutting down. Here is my simple code: Private Sub Command1_Click() Shell "C:\abc.bat", vbNormalFocus End Sub ...
4
by: Larry Bud | last post by:
Not sure where else to post this.... One of our developers quit and I'm taking over stuff from him. He had a COM app that would lock files on occasion (yeah, thanks for leaving that in...
2
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I am monitoring web apps with the windows event log and noticed several (Hosting environment is shutting down) statements. The server appears to still be running, just wondering any ideas on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.