473,773 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I let the internet explorer start to navigate in the same windwo?

Hi everyBody:

I have this question which really drive me cruzy,
By using VB.Net:

How can I let the internet explorer navigate in the same window either
by using win32 API or by using Microsoft Internet Control refreance to
my project ?

some body toled me to use ShellExcute Function in API but I tried it
and it did not work and some body give me this code :

Option Explicit
Private MyExplorer As InternetExplore r

Private Sub Command1_Click( )
FirstExplorer.N avigate "www.google.com "
End Sub

Public Function FirstExplorer() As InternetExplore r
' REFERENCE Microsoft Internet Controls for:
Dim SW As ShellWindows
Dim IE As InternetExplore r

If MyExplorer Is Nothing Then

Set SW = New ShellWindows
For Each IE In SW
If TypeName(IE.Doc ument) = "HTMLDocume nt" Then
Set MyExplorer = IE
Exit For
End If
Next

If MyExplorer Is Nothing Then
' If there is no Explorer open, then what?
Set MyExplorer = New InternetExplore r
End If
End If

Set FirstExplorer = MyExplorer

End Function

and alos it did not work with me, and also I used the send function as
follwoing:

Sendmessage(hwn d,WM_SETTEXT,0, "http;//www.yahoo.com/" )

and I foucs that this message set the address bar of the internet
explorer to the url but it did not start to navigate .

So finally Any hlep will be appreciate to solve this problem

Regard's

Husam

Nov 21 '05 #1
7 4500
Husamal,

You mean simple this

\\\Needs a form with a button
Private Sub Form7_Load(ByVa l sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Dim p As New Process
Dim pi As New ProcessStartInf o
pi.FileName = "http://www.Google.com"
p.StartInfo = pi
p.Start()
End Sub
Private Sub Button1_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button1.Click
Dim p As New Process
Dim pi As New ProcessStartInf o
pi.FileName = "http://msdn.microsoft. com"
p.StartInfo = pi
p.Start()
End Sub
///
I hope this helps,

Cor
Nov 21 '05 #2
"Cor Ligthert" <no************ @planet.nl> schrieb:
\\\Needs a form with a button
Private Sub Form7_Load(ByVa l sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Dim p As New Process
Dim pi As New ProcessStartInf o
pi.FileName = "http://www.Google.com"
p.StartInfo = pi
p.Start()
End Sub
Private Sub Button1_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button1.Click
Dim p As New Process
Dim pi As New ProcessStartInf o
pi.FileName = "http://msdn.microsoft. com"
p.StartInfo = pi
p.Start()
End Sub
///


This will only work if Internet Explorer is configured to reuse existing
windows. Otherwise a new window will be opened.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
I agree with Herfried on that one, Cor

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #4
Crouchie,

Did I not, however when it is, than it works as asked.

:-)

Cor
Nov 21 '05 #5
<hu************ @yahoo.com> schrieb:
How can I let the internet explorer navigate in the same window either
by using win32 API or by using Microsoft Internet Control refreance to
my project ?

some body toled me to use ShellExcute Function in API but I tried it
and it did not work and some body give me this code :

Option Explicit
Private MyExplorer As InternetExplore r

Private Sub Command1_Click( )
FirstExplorer.N avigate "www.google.com "
End Sub

Public Function FirstExplorer() As InternetExplore r
' REFERENCE Microsoft Internet Controls for:
Dim SW As ShellWindows
Dim IE As InternetExplore r

If MyExplorer Is Nothing Then

Set SW = New ShellWindows
For Each IE In SW
If TypeName(IE.Doc ument) = "HTMLDocume nt" Then
Set MyExplorer = IE
Exit For
End If
Next

If MyExplorer Is Nothing Then
' If there is no Explorer open, then what?
Set MyExplorer = New InternetExplore r
End If
End If

Set FirstExplorer = MyExplorer

End Function


Add a reference to "Microsoft WebBrowser Control", then use this code
(tested on Windows XP SP2, IE6 SP2):

\\\
Imports SHDocVw
..
..
..
Private MyExplorer As InternetExplore r

Private Sub Form1_Load( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles MyBase.Load
FirstExplorer.N avigate("http://www.google.com/")
End Sub

Public Function FirstExplorer() As InternetExplore r
' REFERENCE Microsoft Internet Controls for:
Dim SW As ShellWindows
Dim IE As InternetExplore r
If MyExplorer Is Nothing Then
SW = New ShellWindows
For Each IE In SW
If TypeName(IE.Doc ument) = "HTMLDocume nt" Then
MyExplorer = IE
Exit For
End If
Next IE
If MyExplorer Is Nothing Then

' Window not yet opened, open new window.
MyExplorer = New InternetExplore r
MyExplorer.Visi ble = True
End If
End If
FirstExplorer = MyExplorer
End Function

Private Sub Button1_Click( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles Button1.Click
FirstExplorer.N avigate("http://www.activevb.de/")
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #6
Crouchie,

However that is the default setting

When it is in another way and want it in the same window than you are
overiding user preferences. What is not right in my opinion.

When it has to be in a new window, it is easily to do, see for that the
answer in this message

http://groups-beta.google.com/group/...b84f389d055d2b

Cor
Nov 21 '05 #7
Herfried,

Nice

:-)

Cor
Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9457
by: gcash | last post by:
Most folks know you can start up an instance of Internet Explorer by saying "x=win32com.client.Dispatch('InternetExplorer.Application.1')" and you get a WIN32 object with a "Document" object that has arrays of "Link"/"Form"/"Frame" subobjects, and methods like "Navigate" where you can force the IE instance to browse to a new URL. What folks would like to do is to connect to an already running version of explorer, and this isn't so...
5
6928
by: Clemens Ortwickler | last post by:
Hello Is it possible with JavaScript to prevent that a User is closing the Internet Explorer? Because it is important for me that the User pushes the cancel Button of this webapplication how can i do this? Thanks for your help
5
5425
by: Adam Stirk | last post by:
Hi, I have a application that I need to create multiple new "iexplore.exe" processes (show more than once in taskmanger) and control them using the shdocvw/mshtml. I am able control Internet Explorer with instances created with the shdocvw. e.g. Activator.CreateInstance(Type.GetTypeFromProgID ("InternetExplorer.Application");
2
3114
by: Graham | last post by:
Hi everyone I'm having a couple of problems with the Internet Explorer browser control. I'm using VS.NET 2003 on Win2k SP4 with IE6. First, let me briefly describe how it's used in my project. 1. I have a DLL containing a form which hosts the IE Browser control, using the AxInterop stuff that is generated when you add a reference to the COM ShDocVw
1
1539
by: Husam | last post by:
Hi EveryBody: I used the sendMessage function to change the url of internet Explorer to www.yahoo.com and here what I did : SendMessage(hWnd, WM_SETTEXT, 0, "http://www.yahoo.com/") but I face this problem that the internet explorer did not start navigate to the url that I set which is www.yahoo.com, so any help that let me know how to make the internet explorer start navigate by using win32 api to the url
0
1252
by: Husam | last post by:
Hi EveryBody: I got this decleration from msdn documntation which is: object.Navigate( _ url As String, _ _ _ _ )
11
11626
by: Wendy | last post by:
Hello, I have a program that does the following: When a user clicks on a row in a VB.NET datagrid, it will open a web page in Internet Explorer (that corresponds to that item in the selected row in the datagrid). It will automatically print that web page, and then it will close the Internet Explorer window. I have code that works perfectly when a regular web page is opened, however when a pdf web page is opened the printing never...
9
7732
by: Etayki | last post by:
Hi! I am new to VB.net and I am using the Visual Basic 2005 Express Edition I have two questions: 1. I am trying to write an application that will automate Internet Explorer and store data in a database. Am I better off learning VB.net or C#.net? Is there a free development environment for C# as well?
3
9589
by: Matthew Lock | last post by:
Hello, I am automating Internet Explorer in order to do some simple automated testing of a web application. How do I invoke Javascript functions in the web page I load? I can successfully start an instance of Internet Explorer and control the DOM, but I don't know how to call Javascript functions. Here is the code I am using so far: public class WebBrowser
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.