Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have created a windows service. In this windows service I have done Process.Start() for my windows form based GUI application. When i start the service after installation, I can see the process running in my windows task manager but can't see the GUI of the windows form application.

Please help!
Posted

That's because the service is running as LocalService, NetworkService or LocalSystem and neither of those has an interactive desktop or can access the user desktop. A service also isn't supposed to have a user interface. You could create another process that can be executed by the active user and communicates with the service and provides a GUI interface for the service.

As side note, you can create an interactive service but it is not without warning. You can look at the link below for more info on this but it would be better to communicate with the service instead of adding a user interface to it.
http://msdn.microsoft.com/en-us/library/ms683502%28v=vs.85%29.aspx[^]

Communicate with windows services:
http://msdn.microsoft.com/en-us/library/aa288037%28v=vs.71%29.aspx[^]

Good luck!
 
Share this answer
 
v2
Hi. What version of Windows are you running? It is relatively easy to see the GUI of a service (on the "console" session) on Windows 2000, XP and Server 2003, but the situation changed dramatically in Windows Vista (and beyond). Microsoft's "Session Zero Isolation"[^] security enhancements have relegated any GUI elements from a Windows Service to a special desktop that no user is allowed to log in to, making it a giant pain for Windows Services to show windows and tray icons.

BTW, we will be discussing this point in our recently-started Windows FAQ so check back for some more discussion in the coming weeks:
http://www.coretechnologies.com/WindowsServices/FAQ.html[^]

Good luck.
 
Share this answer
 
hi,
i know we can't have a GUI for windows service.
and so I have created my GUI based windows application.
then i have called this exe file of the windows app in my windows service.
when i start my service after deploying i was unable to see the GUI of window app running. but now i have set the properties of service in administrative tools -> services -> right click -> goto properties -> under Log On tab check allow to interact with desktop.

So my problem is solved now . I can see the GUI of windows app running through service.

thanks for your responses :)
 
Share this answer
 
Comments
Arti Vengurlecar 26-Jun-14 1:40am    
Hi Member 7797800,

I want to the similar windows service. I am new to it, could you please explain from the code point of view as to how you have done the windows service?

This will help me a lot.

Thanks in advance.
You can not use an interface for the service. They are just the DLL files running in the background, and performing some task..
 
Share this answer
 
this can be done by setting the properties of service in administrative tools -> services -> right click your service -> goto properties -> under Log On tab check allow to interact with desktop.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900