I'm trying to minimize internet explorer after starting. If i don't have any window before then it works fine. and if i already have instance of IE. then it doesn't minimize .
ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe");
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
string sub;
startInfo.Arguments = "www.google.com";
Process.Start(startInfo);
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

ali tuncerRank #1,499 · 1.1K reputationPosted Jun 27, 2016, 8:12 PM EDT
you can use Windows API, ShowWindow or ShowWindowAsync function
public static extern int ShowWindow(int hwnd, int ncmd);
public static void MinimizeWindow(Process process)
{
try
{
ShowWindow(process.MainWindowHandle.ToInt32(), 2);
}
catch (Exception e)
{
//log exception
}
}
Posted Jun 29, 2016, 5:53 AM EDT