1
votes

I am new to vb 6.0.

I have to open any browser other than Internet Explorer in the web browser control of vb (which open IE by default)

I have tried many codes and I can now open browser as if it is new window (by using process.start etc)

Is there any way to open it in existing vb control?

3
VB.Net 6.0 that it self Wrong. either Visual Basic 6.0 or Visual Basic.NEt (.Net 2.0, 3.0,3.5, 4.0, 4.5). You can use WebBrowser Control is availlble in Visual Studio. Do you want to Open Chorme / Safari if that you can open chorme by Proces.Start . the question is not proper to give answer. - Akshay Joy
yes it is Visual Basic 6.0 , I can open IE with web browser control and I want it to be mozilla or any webkit browser instead, Is it possible to do? - user1079065
You can use Mozilla FirFox also - Akshay Joy
What do you want to accomplish by using a webbrowser control other than IE that you cannot accomplish with it? - Hanlet EscaƱo

3 Answers

2
votes

The web browser control IS Internet Explorer. So unless chrome et al release a ActiveX control of their browser, which they haven't, it is not possible.

There is a workaround is that you start chrome and then hook it's CreateWindowsEx and put your Apps Window as the owner. Then size it where you would have the web browser control using SetWindowPos. This gives the following features

  • An owned window is always above its owner in the Z order.

  • The system automatically destroys an owned window when its owner is destroyed.

  • An owned window is hidden when its owner is minimized.

0
votes
Private Sub Command1_Click()

  sAppName = "Google Chorme"
  sAppPath = "C:\Users\082043\AppData\Local\Google\Chrome\Application\chrome.exe"


    Shell sAppPath, vbMinimizedFocus

End Sub
0
votes

You could try the following code to invoke the default browser (applies to VB 6).

Place this at very top, but below the 'Option' declarations.

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Place this where 'Sub' are placed' This invokes the default browser to go to google.com.

Private Sub cmdBUTTON_Click()

ShellExecute 0&, vbNullString, "http://www.google.com", vbNullString, vbNullString, 10

End Sub

You could find information on the variables here .