I have a C # application that runs as a Windows service managing socket connections and other things. In addition, there is another application of Windows forms for managing and configuring this service (systray with starting, stopping, displaying a form with configuration parameters).
I use .net remoting for IPC, and that was fine, but now I want to show some real traffic and other reports, and remote execution will not meet my performance requirements. Therefore, I want to combine both applications in one.
Here is the problem:
When I ran the form from windows service, nothing happened. Going to the search, I found that I need to right-click the service, go to "Login" and check the box "Allow the service to interact with the desktop." Since I do not want to ask my users to do this, I again received code to run it again to set this parameter in user regedit during installation. The problem is that even setting this option does not work. I need to open the login parameters (it is verified), uncheck the box and check again.
So how to solve this? What is the best way to have a windows service with a systray control in the same process available for any user login?
UPDATE: Thanks for the comments guys. I agree that it is better to use IPC, and I know that mixing Windows services and user interfaces is bad. Although I want to know how to do this.
c # windows windows-services
andrecarlucci
source share