0

Does anyone know how I can programatically find the service name hosted by a TaskHost instance given it's pid?

Keith Giddings
  • 251
  • 1
  • 3
  • possible duplicate of [How can a Windows Service determine its ServiceName?](http://stackoverflow.com/questions/1841790/how-can-a-windows-service-determine-its-servicename) – Roman R. Aug 19 '14 at 11:15
  • No,not the same. I'm trying to find out which service is being hosted by TaskHost from another monitoring process that is similar to Task Manager. – Keith Giddings Aug 19 '14 at 13:36
  • Yes, this is different from the linked question, however note that it mentions lookup by process identifier, and this is what you can also do from external monitoring app. That is, the solution there does not require that the call takes place from the service itself. – Roman R. Aug 19 '14 at 13:39
  • The linked question is for C# apis. Unfortunately it's not much use to me which is why I specified WinAPI in the tags. I guess I could try to find the relevant lower level WMI calls if no-one has another solution. – Keith Giddings Aug 19 '14 at 14:19
  • WMI in C++ looks not scary as it might seem: [example](http://www.pcreview.co.uk/forums/starting-stoping-service-using-wmi-and-c-c-t2117888.html). Then you have interactive tool [`WBEMTest`](http://www.codeproject.com/Articles/46390/WMI-Query-Language-by-Example). – Roman R. Aug 19 '14 at 14:37

0 Answers0