When I run a service as LocalSystem account, I can use following codes to launch a GUI program under current login account:
WTSGetActiveConsoleSessionId->WTSQueryUserToken->CreateProcessAsUser
However, when I run the service as my personal account, the GUI program will NOT show up. I can see it in task manager though.
What should I do to launch the GUI program when the service is running under my personal account?
The service communicates with the GUI application to tell it when to display the GUI. The application communicates the results of the user interaction back to the service so that the service can take the appropriate action.
Windows services cannot have GUIs, so you will need to either get rid of the GUI or separate your application into two pieces - a service with no UI, and a "controller" application.
John and jdigital are both right - from my understanding, services can generally have either desktop access (you have to use localsystem) or network access (you need to specify an account to run under).
You will need two split your app into two - one to interact with the desktop and the other to talk over the network. The two parts can then talk to each other to relay info to the end user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With