>Hmm. I just tried implementing the SERVICE_ACCEPT_PRESHUTDOWN option but can't get it to work either (Win 7). I can set the private field in OnStart and verify that the value has changed - but if I look at the running service using the ServiceController then the 'commandsAccepted' value is still 5 (rather than 261) and, of course, the OnCustomCommand doesn't fire for shutdown.
>
>I'll try the ADVAPI32.DLL SetServiceStatus approach if I get time.....
That seems to be exactly what I have faced so far.