如何在C++中获取Windows服务的状态?
这是一个C#示例:
ServiceController sc = new ServiceController("Spooler", "Server1");
if (sc.Status == ServiceControllerStatus.Running)
{
MessageBox.Show("The service is running.");
}
Run Code Online (Sandbox Code Playgroud)
但是我如何在C++中做相同的操作呢?