I’m writing a service in “C” and I’d like to display a warning window once the user tries to stop the service ( With “OK” and “Cancel” Buttons ).
Is there any specific windows API available to achieve this?
Any other simple ways are there to achieve??
No, this is not possible. Windows services are unable to interact directly with the user’s desktop, so they will be unable to show a user interface of any kind.
This shouldn’t really be a big deal, though. You have to have adequate permissions to stop and start a service, and by default, only Administrators have those rights. If you don’t want users inadvertently stopping your service, then you should take advantage of permissions to solve that problem for you.