Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi there,
I can open notepad and minimize the window with following code:

ProcessStartInfo startInfo = new ProcessStartInfo("notepad.exe");
startInfo.WindowStyle = ProcessWindowStyle.Minimized;

startInfo.Arguments = "www.google.com";

Process.Start(startInfo);

But I can't open IE and minimize it:
ProcessStartInfo startInfo = new ProcessStartInfo("iexplore.exe");
startInfo.WindowStyle = ProcessWindowStyle.Minimized;

startInfo.Arguments = "www.google.com";

Process.Start(startInfo);

How can I open IE and Minimize it?
By the way, I use IE9 and Win7.
Posted

1 solution

Hi,

Since, iexplore.exe is not having any command line parameter to minimize while launch, you can write the below vbscript to achieve that.
VB
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """c:\program files\internet explorer\iexplore.exe"" http://www.google.com""",2


Best Regards
Muthuraja
 
Share this answer
 
Comments
Laohutu 29-Jan-13 7:17am    
Muthuraja,
Thanks for your help. Would you please let me know how to implement it in C#? because all my other codes are in C#.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900