I have made a system tray app in C#, which is just running in the background. It is listening on a mailserver using Exchange WebServices, and performs a set of actions each time a mailaccount receives a message. It is using a number of Excel applications, which does not work properly if I convert to program to a service (which is why it has to be a system try app).
It is important that the program does not run more that once at a time. I have added a mutex lock, so I cannot run the program more than once on the same session. The problem is however, when I log into another session on the Windows Server (it can have two sessions per user), the program is not visible in the system tray, and I can open it again, so it runs twice, once in each session. How do I prevent this?
Thanks