Is there any tool to send (mimic) a windows message like \'WM_ENDSESSION\' to a windows service?
OR
How can I send a windows message to a process using C#?
Services should be controlled using ServiceController class
Represents a Windows service and allows you to connect to a running or stopped service, manipulate it, or get information about it.
You can use it to start, stop and communicate with services using this class.