如何恢复后台运行应用程序? [英] How to Restore Background Running Application?

查看:314
本文介绍了如何恢复后台运行应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Windows应用程序。

运行应用程序然后最小化应用程序,隐藏应用程序进入系统托盘。

第二次打开相同的应用程序,第一次打开应用程序恢复来自托盘。

例如:

Internet Download Manager应用程序运行背景。用户打开IDM打开当前运行的应用程序显示,但没有打开新窗口。



如何在.net应用程序中使用此概念?

I am Using Windows Application.
Run Application then Minimized Application, Hide Application go to System tray.
Open the Same application second time, First time open application restore from tray.
Eg:
Internet Download Manager application running background. user open IDM open current running application showed, but not open new windows.

How to use this concept in .net application?

推荐答案

请看我对你的问题的评论,这个问题没有任何意义。特别是,要使用托盘,您可以基于类 System.Windows.Forms.NotifyIcon 创建应用程序:

https://msdn.microsoft.com/en-us /library/system.windows.forms.notifyicon%28v=vs.110%29.aspx [ ^ ]。



见此页面上的代码示例。



-SA
Please see my comment to your question, which makes little sense as formulated. To work with the tray, in particular, you can create an application based on the class System.Windows.Forms.NotifyIcon:
https://msdn.microsoft.com/en-us/library/system.windows.forms.notifyicon%28v=vs.110%29.aspx[^].

See the code sample on this page.

—SA


Venthan写道:
Venthan wrote:

应用程序正在运行并出现在托盘中。

但用户两次打开相同的应用程序,打开两个运行的应用程序。

i希望第一个应用程序运行,但第二个应用程序关闭,第二个应用程序打开第一个应用程序,如果第一个应用程序在系统托盘中最小化。

例如:

IDM,Antivirus和一些运行托盘应用程序。

Application is running and present in tray.
But User Two time open the same application, Open the two application running.
i want first application running but second application close and second application open the first application if first application minimized in system tray.
Eg:
IDM, Antivirus and some running tray application.

这是一个单独但相关的问题:模拟单实例行为的应用程序进程行为。这实际上是一个模拟:所有应用程序都可以按照定义在任意数量的实例中启动,但是您可以在它们之间进行通信,并实现第一个和第二个实例的适当行为,因此,第二个实例不会长寿。



我有一个非常强大的解决方案并解释了我过去答案中的所有想法:

自定义Windows右键单击命令启动多个实例 [ ^ ],

< a href =http://www.codeproject.com/Answers/556737/Enterplusmultiplepluscommandsplustoplusonlyplusone#answer1>只向一个流程实例输入多个命令 [ ^ ]。



您必须结合我在解决方案2中描述的解决方案和此解决方案。试一试吧。如果您遇到问题,欢迎提出您的后续问题。



-SA

This is a separate but related issue: the application process behavior simulating single-instance behavior. This is really a simulation: all applications can be started in any number of instances by definition, but you can communicate between them and implement the appropriate behavior of just first and second instance, so, the second one would not live long.

I have a very robust solution and explain all the ideas in my past answers:
Custom Windows right-click command launching multiple instances[^],
Enter multiple commands to only one process instance[^].

You have to combine the solution I described in Solution 2 and this solution. Just try it out. If you face problems, your follow-up questions will be welcome.

—SA


我想你正在寻找这个: C#Single Instance App能够从系统托盘中恢复(使用互斥锁) [ ^ ]
I think you are looking for this: C# Single Instance App With the Ability To Restore From System Tray (Using Mutex)[^]


这篇关于如何恢复后台运行应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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