当用户尝试打开新实例时返回到已打开的应用程序 [英] Return to an already open application when a user tries to open a new instance
本文介绍了当用户尝试打开新实例时返回到已打开的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是一个我已经有一段时间无法弄清楚的问题.防止第二个实例是微不足道的,有很多方法,但是,恢复已经运行的进程不是.我想:
This has been a problem that I haven't been able to figure out for sometime. Preventing the second instance is trivial and has many methods, however, bringing back the already running process isn't. I would like to:
- 最小化:撤消最小化并将正在运行的实例置于最前面.
- 在其他窗口后面:将应用程序放在前面.
我使用的语言是 VB.NET 和 C#.
The language I am using this in is VB.NET and C#.
推荐答案
我发现这段代码很有用.它对现有应用程序进行检测和可选激活:
I found this code to be useful. It does the detection and optional activation of an existing application:
http://www.codeproject.com/KB/cs/cssingprocess.aspx
这篇关于当用户尝试打开新实例时返回到已打开的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文