![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Create Windows service that captures shutdown. Hi, as title suggests, I want to create a windows service that can be notified that the computer is shutting down. When it receives this signal it needs to block for about 10 seconds to write some stuff to a file before allowing the machine to continue with shutdown (or possible stop the shutdown if there was an error so that the user can be informed) I am using Visual Studio.NET 2003 and used the windows service template that it provided. I see that the template has a 'CanShutdown' property which means that it should get the shutdown signal when it is terminating but I don't this this will be anygood for cancelling the shutdown if need be. Does anyone know if there is a way to cancel the shutdown without having to create a window and capturing the WM_QUERYENDSESSION message? Regards, John. |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Create Windows service that captures shutdown. Hi, You might want to look into WMI. Might be a place to start. Thanks "John" wrote: Quote: > Hi, > > as title suggests, I want to create a windows service that can be > notified that the computer is shutting down. When it receives this > signal it needs to block for about 10 seconds to write some stuff to a > file before allowing the machine to continue with shutdown (or possible > stop the shutdown if there was an error so that the user can be informed) > > I am using Visual Studio.NET 2003 and used the windows service template > that it provided. I see that the template has a 'CanShutdown' property > which means that it should get the shutdown signal when it is > terminating but I don't this this will be anygood for cancelling the > shutdown if need be. > > Does anyone know if there is a way to cancel the shutdown without having > to create a window and capturing the WM_QUERYENDSESSION message? > > Regards, > > John. > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Create Windows service that captures shutdown. Chris wrote: Quote: > Hi, > You might want to look into WMI. Might be a place to start. > > Thanks > > "John" wrote: > Quote: >> Hi, >> >> as title suggests, I want to create a windows service that can be >> notified that the computer is shutting down. When it receives this >> signal it needs to block for about 10 seconds to write some stuff to a >> file before allowing the machine to continue with shutdown (or possible >> stop the shutdown if there was an error so that the user can be informed) >> >> I am using Visual Studio.NET 2003 and used the windows service template >> that it provided. I see that the template has a 'CanShutdown' property >> which means that it should get the shutdown signal when it is >> terminating but I don't this this will be anygood for cancelling the >> shutdown if need be. >> >> Does anyone know if there is a way to cancel the shutdown without having >> to create a window and capturing the WM_QUERYENDSESSION message? >> >> Regards, >> >> John. >> WMI looks very useful indeed. I think I've got a alot of reading to do now. Thanks for the pointer. Regards, John. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Request for Microsoft to create Service Pack specific newsgroup for Vista | Vista installation & setup | |||
| Quick Tip: Create Shutdown / Restart / Lock Icons in Windows Vista | Vista General | |||
| Snipping Tool bad captures...Look at Pics | Vista General | |||
| Screen Captures | Vista General | |||