Send windows message to a Windows Service

前端 未结 7 1934
隐瞒了意图╮
隐瞒了意图╮ 2021-02-06 05:57

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#?

7条回答
  •  一整个雨季
    2021-02-06 06:41

    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.

提交回复
热议问题