C#进程启动焦点问题

Ben*_*y F 4 c# focus process


当我开始一个新的过程时,它会自动获得焦点.如何防止它获得焦点或者将焦点重新集中到我的应用程序?

这是我正在使用的代码:

string path = @"c:\temp\myprocess.exe";  
ProcessStartInfo info = new ProcessStartInfo(path);  
info.WorkingDirectory = path;  
Process p = Process.Start(info);  
Run Code Online (Sandbox Code Playgroud)

我只需要执行的过程不要获得焦点.

非常感谢,
Adi Barda

Uwe*_*eim 5

WindowStyle属性设置为Minimized可能会有所帮助.

  • 我认为它仍然需要关注,即使它没有显示 (3认同)