2

Im looking for some advice on an application im creating using a windows service. Basically we have some timesheet software and i need to create a windows service that will poll a db to see if they have completed last weeks timesheet. If they havent completed it i want the application to popup a message stating that it is incomplete and that they should go and complete it.

Ive created a simple service from a tutorial i found and got it to install and run fine. I now need to think about the form side that popups up. Thing is im not sure its a good idea to do this from a service. Can anyone give me a steer on the best way to develop this application using a windows service.

Richard Banks
  • 2,946
  • 5
  • 34
  • 71
  • Does this answer your question http://stackoverflow.com/questions/6204634/how-can-i-show-a-notification-area-balloon-and-icon-from-a-windows-service – Lloyd Jan 09 '12 at 12:22

3 Answers3

1

as mentioned earlier you may not create userinterfaces from within Services. In order to achieve this. you have to build another application. you can use Windows Forms or WPF for building the NotificationArea inteagration application.

I would use WCF with net tcp binding to communicate between both applications.

Thorsten Hans
  • 2,675
  • 19
  • 21
0

Well as you aslmost said your self. This is not well suited for a windows service since there is nothing going on when a user is not logged in. If on the other hand you were also sending mails AND showing pop up a duel approach would be ideel.

I recommend scrapping the service and only use your form.

Esben Skov Pedersen
  • 4,437
  • 2
  • 32
  • 46
0

You could develop ANOTHER WinForms application that reads from a Database (for example) every X seconds

Your Windows Service will write to the Database indicating whether the job is done or not.

once your Winforms application (that can sit in the system tray for example) reads from the database and sees the job is not done - make it pop up and alert the user.

Just a thought!

Shai
  • 25,159
  • 9
  • 44
  • 67
  • Seems like i potentially dont need a service. Just an app that sits in the sys tray. hmmmmm – Richard Banks Jan 09 '12 at 12:28
  • Take in mind that an application that sits in the system tray won't run 24/7 UNLESS the user is logged on permanently, which is a downside for this solution. – Shai Jan 09 '12 at 12:34
  • It will only need to run when the user is logged on. Ill start researching thanks – Richard Banks Jan 09 '12 at 13:09