Click here to Skip to main content
11,709,220 members (59,299 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: IE7 C#
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 28-Jan-13 20:22pm
Laohutu378

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,

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

Best Regards
Muthuraja
  Permalink  
Comments
rzhao at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 565
1 OriginalGriff 244
2 Maciej Los 225
3 Peter Leow 219
4 Mika Wendelius 160
0 OriginalGriff 9,348
1 Sergey Alexandrovich Kryukov 8,727
2 CPallini 5,189
3 Maciej Los 4,991
4 Mika Wendelius 3,856


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100