Click here to Skip to main content
13,006,360 members (70,716 online)
Rate this:
 
Please Sign up or sign in to 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 28-Jan-13 20:22pm
Laohutu467

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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170628.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2017
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