Start IE window from forms app

  • Thread starter Thread starter Oleg Ogurok
  • Start date Start date
O

Oleg Ogurok

Hi all,

How can I start a browser window from a Windows Forms application and resize
it, e.g. maximize it?

Here's what I've tried so far but it didn't help:

ie.FileName = "iexplore.exe";

ie.Arguments = "http://www.yahoo.com/";

ie.WindowStyle = ProcessWindowStyle.Maximized;

Process ieProc = Process.Start(ie);

-Oleg.
 
I used code almost identical to yours and it seemed to work fine.

ProcessStartInfo info = new ProcessStartInfo("iexplore.exe",
"http://www.yahoo.com/");
info.WindowStyle = ProcessWindowStyle.Maximized;
Process.Start(info);
 
Try this instead, because your code I tried before but it had some issues.

System.Diagnostics.Process.Start(mailto:[email protected]?info);
or
System.Diagnostics.Process.Start(http://www.foo.be);

I don't know about the maximize thing, but I guess this could work;
(didn't test it yet)

ProcessStartInfo info = new ProcessStartInfo("http://www.foo.be");
info.WindowStyle = ProcessWindowStyle.Maximized;
Process.Start(info);
 
It seems to be working fine on WinXP. However, on Win2000, the window comes
up not maximized.

I tried the same executable on both machines.

-Oleg.
 
My dev machine is Windows 2000 Professional and it worked ok. Maybe it's an
issue somewhere else?
 
Back
Top