Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# process start focus issue

Tags:

c#

focus

process


When I start a new process, it automatically gets the focus. how can I prevent it from getting the focus or instead get back the focus to my application?

here is the code I'm using:

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

I just need the executed process not to get the focus.

Thank you very much,
Adi Barda

like image 799
Benny F Avatar asked Oct 15 '25 10:10

Benny F


1 Answers

Maybe setting the WindowStyle property to Minimized can help.

like image 63
Uwe Keim Avatar answered Oct 17 '25 00:10

Uwe Keim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!