pro.StartInfo.FileName = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";
pro.StartInfo.Arguments = a;
pro.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
pro.Start();
I have this code above which starts Firefox minimized. but Firefox does not actually start minimized but as a normal window. What is the problem with my code? Do I have to sleep the thread for 100 ms ?
Try out this one :)
pro.StartInfo.FileName = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";
pro.StartInfo.Arguments = a;
pro.UseShellExecute = true;
pro.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
pro.Start();
As I think this will only work if firefox is NOT running. Else it will still open firefox, but not minimized. If you want to minimize your own starting firefox if the process is already up, you will need to handle ShowWindow
as described here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With