Search code examples
c#.netsingle-instancenotifyballoon

single instance and notify in system tray


I am working on the application (C# 2.0). I have implemented single instance in it. Everything is fine. If i run the application again, it shows messagebox saying "instance is already running".

Actually i don't want to show the message through messagebox.

I want to show this message using Balloon tip of already running instance (it has notify icon in system tray).

How can i achieve this?

Thanks in advance.


Solution

  • You need a form of interprocess communication, to signal to the other instance that it should display the messagebox.

    In this instance, you could go one better than telling the existing instance to display the message, and instead tell it to restore it's main window (i.e. "unminimise").