How can I navigate to different web pages in the same MSIE window in VB.NET
I'm not sure exactly, but getting the window handle you are interested in might be a good pointer to start with:
http://www.pocketpcdn.com/articles/dotnetcf_hwnd.html
And then examine separately what interop messages you can send in IE to change the url in the X tab
a source to share
In order of increasing difficulty and increasing control / power:
- Send input text to your IE process. Alt-D to focus on the navigation bar, then the URL, then press ENTER.
- Use MSAA to find the navigation bar and submit it as above.
- Use MSAA to access the IHTMLDocument browser, and then programmatically control the browser with that and associated interfaces.
I don't know your exact scenario, but if you can host your own MSHTML instance or WebBrowser control, it makes it easier to get the interfaces and does the manipulations mentioned in # 3 above; doing this cross process is fraught with danger.
I just did a web search and included the WatiN tool , which seems to wrap a lot of this work; maybe it would be helpful for you.
a source to share
Use the following code:
System.Diagnostics.Process.Start("http://www.live.com")
That is: don't call iexplore.exe
directly - just let the system know which browser to open by default.
This can lead to two types of behavior:
- Or it opens a new tab in an existing Internet Explorer window,
- or creates a new window.
The important point is that it depends on the preference, which can be controlled in the Internet Explorer application. If a new window opens, then this is a user-selected setting - don't try to override it: overriding user preferences is considered bad manners.
If users don't want to open a new window, they can simply change this in their Internet Explorer settings.
a source to share