Question

We have developed a network based C++ application that should run as a service for Windows XP, 7 32-bit system.

  • The application is console based.
  • User should be able to see the logs in console once the app is up and running.

To make application run as a service , we used XYNTService

The application is working as a service and it works fine under XP.

But I am not able to see the console under Windows 7, Since the service is running under the local SERVICE account, probably we can not see the GUI or access it in any way, because it is running in another winlogon session.

So can some one please suggest how can we make the service interactive so that user can see logs on the console while the app is running as a service?

Else What if I make it a tray based application, is there a way to redirect logs a window?

Was it helpful?

Solution

Actually you can subscribe to logon/logoff events and then use WTSEnumerateSessions with CreateProcessAsUser to create GUI each time user logs into system, however it's not a good choice.

Making a tray app that automatically runs when user logs into system is better idea, you can use any of IPC mechanisms (named pipes, shared memory, sockets) to sent logs from service to tray app.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top