Search code examples
windows-serviceshooknotifyicon

Windows Service or Tray/NotifyIcon?


I want to write an app that will, given some network input, simulate mouse movements, clicks, and keyboard input. How and Why i want to do that is a different discussion :-) What I'd like to hear from SO is what would be the preferable model for an app/service like this?

  • Should I make a windows service that sits in the background running as system?
  • or should I make a tray app that sits in the tray listening and manipulating the user's input?

I haven't started working on it, so some of the things I'd imagine would trip me up would have to do with the service not having an interactive session, and/or permissions.

Anything I should anticipate or keep in mind?


Solution

  • Aaron gave all the arguments why you can't do without the tray app, but why add the complexity of a service communicating with the app through IPC ?

    A service is useful when you need to have code running even when no user is logged in. This isn't the case here, right ?

    Unless you have to manipulate the input of multiple users logged in at the same time, I would go with only the tray app doing both tasks of monitoring network events and manipulating user input, it's way simpler to me.