How to get a Windows Service custom Status? [C++/C#]

I have a created a C# windows service (Serv.exe) which is responsible for performing various tasks at the request of a running application (A.exe), some of these can take long periods of time and I need a way to know the status of my requested operation (running on the service) from the calling application (A.exe).

Currently the way I have started to implement this is by using the ControlService(handle, command, status) to send a custom command to the Service to perform the task being requested, I am also using QueryServiceStatus(handle, status) to get the status of the service from the SCM - so the basic plumbing is there and working.

Now the problem I have is, after sending my ControlService Command (which works fine) the calling application (A.exe) keeps running and, at a certain point, it needs to know if the task it requested of the service is finished or not - therefore I am looking for a way to Query the Service to report a custom status, not the standard running, stopped, pending, paused state of the actual service but the status of the request I made using the ControlService() request.

Is this at all possible?
Any help or hints would be immensily appreciated.

Thanks,
I'm not sure if what you want is possible. Instead, I wouldn't break my head with it. Do you want custom information? Set up an interprocess communication method.

My favorite is a named pipe.

If you are compiling for .Net 3.5, then use the classes under System.IO.Pipes. If not, then create your own classes.

By the way, you would have been better off asking this question in a .Net forum. This is C++.
Topic archived. No new replies allowed.