0

i would like to start a program as user from within a windows-service.

Is this possible?

Background is that i need to display a MessageBox and would simply do something like

            MessageBox.Show(args[0]);

in the program.

1
  • This is almost always a sign of bad design somewhere, what exactly are you trying to achieve in having a GUI on your service? There is nearly always a better solution. Commented Jun 22, 2012 at 11:01

2 Answers 2

1

I ended up having my program in autostart on logon, but it should also be possible to start a program from within a service using e.g. CreateProcessWithLogonW.

Sign up to request clarification or add additional context in comments.

Comments

0

This will not behave as you expect it to. The windows-service is most likely running as LocalSystem, and tied to Session 0. Even if you set the service to allow interaction with the desktop it will most likely not show on the session you're after.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.