检查服务是否正在运行?

时间:2009-08-11 09:26:11

标签: c++ winapi

  

可能重复:
  Querying if a Windows Service is disabled (without using the Registry)?

我需要检查“事件日志”服务是否正在运行。怎么做?

3 个答案:

答案 0 :(得分:6)

使用OpenSCManager(),然后使用OpenService(),然后使用ControlService()。

答案 1 :(得分:0)

您可以执行

>sc query Eventlog

并检查结果。

答案 2 :(得分:0)

可以找到使用Win32 API的一些示例代码here

相关问题