How can I run a Windows GUI application on as a service?

Question :

How can I run a Windows GUI application on as a service?,

Answer :

I have an existing GUI application that should have been implemented as a service. Basically, I need to be able to remotely log onto and off of the Windows 2003 server and still keep this program running.

Is this even possible?

EDIT: Further refinement here… I do not have the source, it’s not my application.


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. If you have the source code, converting the non-GUI code into a service is easy – Visual Studio has a ‘Windows Service’ project type that takes care of the wrapping for you, and there is a simple walkthrough that shows you how to create a deployment project that will take care of installation.

Read More  F# curried function

If you opt for the second route and need to put some of the original GUI code into a controller, the controller and service can communicate via WCF, .NET Remoting or plain socket connections with a protocol you define yourself. If you use Remoting, be sure to use a “chunky” interface that transfers data with as few method invocations as possible – each call has a fair amount of overhead.

If the UI is fairly simple, you may be able to get away with using configuration files for input and log files or the Windows Event Log for output.

Read More  How to get name associated with open HANDLE

That’s the answer How can I run a Windows GUI application on as a service?, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you