Using Shell() to launch IE6 - it starts out minimized

F

felecha

I want my VB.Net application to have a button that the user will click
to open a browser window, and call the webpage I designate in code.
The system is a closed network, no Internet access, but with a
webserver on another machine to serve the page I want, which will be
used for configuring the system on that other machine.

I'm playing around with it, and I can get the browser to launch

Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE
www.somewhere.com")

but it opens minimized to the taskbar. I want it to open in a visible
window, and would really like to be able to specify the window size.
 
F

felecha

Actually - there's still the second question. Can I tell the window
what size to open to?
 
I

Imran Koradia

look at the System.Diagnostics.Process and System.Diagnostics.ProcessInfo
classes instead. These allow you to set a lot more options.

hope that helps..
Imran.
 
F

felecha

Imran - thanks. Still learning, and I am happy to learn about the
Process class.

I also found a trick on a website, that works for sizing and locating
the window.

Shell("""C:\Program Files\Internet Explorer\IEXPLORE.EXE"""
javascript:resizeTo(a,b);moveTo(x,y);document.location.href='http://www.somewhere.com'",
AppWinStyle.NormalFocus)

That apparently opens IE and puts all the rest of the following
argument into the Address Bar, where the javascript stuff takes over
and does what I want. Very interesting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top