473,480 Members | 3,796 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Window Service on Shutdown

I created a window service...

When i stop the service through MMC, it can see in the EventLog that it
calls OnStop() within the service... and all stop handling routines are
processed gracefully...

but when i do, Start, ShutDown to restart the computer, the EventLog
does not show anything...

Can i trust that the OnStop was called anyway? If not, how to make sure
windows calls my OnStop before shutting down?

Thanks.

Oct 19 '05 #1
2 1399
On 18 Oct 2005 22:52:16 -0700, tascien wrote:
I created a window service...

When i stop the service through MMC, it can see in the EventLog that it
calls OnStop() within the service... and all stop handling routines are
processed gracefully...

but when i do, Start, ShutDown to restart the computer, the EventLog
does not show anything...

Can i trust that the OnStop was called anyway? If not, how to make sure
windows calls my OnStop before shutting down?


Override the OnShutdown method. That's what should be called when Windows
is shut down.
Oct 19 '05 #2
Still nothing in the eventLog.

I am just assuming the EventLog is closed when the computer is shutting
down... Isn't it?

Tascien

Oct 19 '05 #3

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

Similar topics

23
7532
by: Adam Clauss | last post by:
I have a C# Windows Service running as the NetworkService account because it needs to access a network share. As part of the service's initialization, I want the service to terminate, if an...
2
1775
by: Mr Newbie | last post by:
I have an annoying teenager who wont go to bed because he is allways on his computer. I want to write a windows service which will shut down his computer at night and not allow this to be...
2
219
by: tascien | last post by:
I created a window service... When i stop the service through MMC, it can see in the EventLog that it calls OnStop() within the service... and all stop handling routines are processed...
0
2112
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...
0
1151
by: Mathew Clark | last post by:
I'm trying to write a Windows Service that is capable of detecting when a shutdown is occurring, and cancelling it. I've managed to get this to work fine in a windows application, using...
6
7007
by: eroc.spam | last post by:
Hello- I'm working with a .NET windows service that can potentially take up to 10 minutes to shutdown. I would like to make it so that SCM doesn't timeout before the service actually stops, but...
6
9480
by: Ash | last post by:
Hi coders, I have a service that does alot of data copying to the database and when the service is stopped or the machine is shutting down it commits the data (in addition to other things) and...
1
5533
by: chitra g | last post by:
Hi, I tried all the options below but did not work. Your suggestions please.
10
3219
by: tshad | last post by:
I have a Windows Service that I need to put to sleep for about 10-20 minutes. The problem is that if you try to shut it down during this time, it will tell you that the service didn't respond in...
0
7040
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,...
0
6905
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...
1
6736
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
6908
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...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4772
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
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1299
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
561
muto222
php
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.