如果另一个实例是 运行,[设置焦点] 并在 'old' 实例上打开文件

If another instance is running, [set focus] and open file on the 'old' instance

如何检查另一个实例是否为 运行?
另外,如果它是 运行,我如何强制我已经打开的实例打开文件?
另外,如果可能的话,我可以强制它获得焦点吗? (我需要单独的)

How can i check if another instance is running ?

您可以使用 Process.GetProcesses() 获取计算机上 运行 的进程列表。并简单地与 Process.Name 进行比较。使用相当简单的名称,您可能需要对您的应用程序进行额外检查。

Also if it is running how can I force my already opened instance to open a file ?

如果你想在2个进程之间进行通信,我会推荐SendMessage方法。参见 here

Also if it is possible can I force it to get focus? ( I need this seperate)

您可以使用 SetForgoundWindow 方法(也需要 P/Invoke)。参见 here