单实例和通知系统托盘 [英] single instance and notify in system tray

查看:243
本文介绍了单实例和通知系统托盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的应用程序(C#2.0)。我在它执行单一实例。一切安好。 如果我再次运行应用程序,它显示消息框,说:实例已在运行。

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?

在此先感谢。

推荐答案

您需要的<一个形式href="http://www.google.co.uk/search?rlz=1C1GGLS%5Fen-GBGB300GB305&sourceid=chrome&ie=UTF-8&q=c%23+interprocess+communication"相对=nofollow>进程间通信,发信号给另一个实例,它应该显示消息框。

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

在这种情况下,你可以去比告诉现有的实例,以显示该消息一筹,而是告诉它来恢复它的主窗口(即unminimise)。

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").

这篇关于单实例和通知系统托盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆