Windows Service Shutdown

G

Guest

I have written a service in vb.net that can take several minutes to perform
one iteration of its process loop.
When windows is being shutdown is it possible to prevent windows from
stopping my service whilst it is in the middle of its processing?
I assume I would need some code in the OnShutdown event but what code?

Thanks
 
P

Peter Huang

Hi

I think we may try to call the AbortSystemShutdown in the OnShutDown
function of our service.

Here is a few article about shutdown.
Shutting Down
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/bas
e/shutting_down.asp

AbortSystemShutdown
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/bas
e/abortsystemshutdown.asp

http://custom.programming-in.net/articles/art9-1.asp?f=AbortSystemShutdown

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top