简单点。
直接上代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace Test
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Process process = GetRunningProcess();
if (process != null)
{
ShowRunningApplication(process);
}
else
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
/// <summary>
/// 获取已运行的进程,未运行返回null
/// </summary>
/// <returns></returns>
private static Process GetRunningP