This is the better approach which is often used:
- Create a "normal" Windows Service. In this service, create a communication channel for the local application, which can be based on named pipes, sockets (
TcpListener
), WFP self-hosted service with a local communication channel, something like that. It could be half-duplex or full-duplex.
If both the service application and your control Windows application (see next item) are .NET applications, WCF is probably the most convenient and flexible solution. - Create a "normal" Windows application. One form very suitable for working with a Window Service could be the application sitting in the system tray, such as the application based on
NotifyIcon
: https://msdn.microsoft.com/en-us/library/system.windows.forms.notifyicon%28v=vs.110%29.aspx[^]. - Register/install your Windows application to start on system start.
- On start, your Windows application tries to connect to the service. When connection is done, it can control the service and get notifications from the service.
I understand that each of the above items could be a matter of a separate question and answer, but it makes little sense to describe it all at once. Try to work on each aspect yourself and ask other questions if you cannot achieve some of those parts.
—SA