0

I have an application that is a Windows Service application. It currently reads an XML file for it's configuration and the code works off those settings.

I have created a separate project that is a Windows Forms application (typical windows app). This app is a GUI interface into the configuration settings (changed from XML to database, but that is relatively unimportant).

What I need to do is:

  • Integrate the 2 projects
  • Add a system tray icon to pop up the form

I'm unsure exactly how to proceed on this and wanted to get some advice before messing things up.

LarsTech
  • 80,625
  • 14
  • 153
  • 225
cb seo
  • 103
  • 12
  • 1) What do you mean with "integrate"? To make them communicate somehow or just to start/stop service? 2) Just use winfoms component – Adriano Repetti Dec 20 '13 at 11:52
  • You just have to host your service and create a Winform app, where you'll add a Service reference to call the logics of the service. :) – Nadeem_MK Dec 20 '13 at 12:03

1 Answers1

2

You can't integrate these two things (entirely). A service is designed to run without a GUI of any kind (there is a work around to allow desktop interaction but this is messy and clunky and will cause you more problems than it solves)

It sounds like you just need to use the code from the service in the forms application. This should be a simple copy and paste operation.

To show an icon in the system tray is pretty easy:

Create a program to run from the system tray

how to put an .net application in system tray when minimized?

Community
  • 1
  • 1
Matt Wilko
  • 26,994
  • 10
  • 93
  • 143
  • I don't want to copy code from one to another. I want to have a single project build and I would like the 2 to interact. Even if it is by some sort of 'message bus' to get information back and forth. The service will be doing all the work but I want things like: statuses, metrics, and log file information - to be pushed from the service into the windows application. – cb seo Dec 20 '13 at 13:51
  • Forgot - yes, I have done a system tray icon on a windows application before, very easy now actually. – cb seo Dec 20 '13 at 13:52
  • I suggest you delete this question then and start again as that is not what you asked. You need to give as much detail as much detail as possible – Matt Wilko Dec 20 '13 at 13:59
  • ok, I thought I was clear - but re-reading I can see where it sounds confusing. – cb seo Dec 20 '13 at 14:23
  • +1 for `A service is designed to run without a GUI`. – Victor Zakharov Dec 20 '13 at 14:32