Reuse browser / tabs in VB.net

I use Process.Start () to open the URL, and it is great for one-time use, but when opening multiple URLs, it creates either a new default browser instance or uses a new tab. I need to use the original tab.

Suggestions?

+1
source share
1 answer

For Internet Explorer, you will need to reference the shdocvw.dllCOM component located by default at c:\windows\system32\shdocvw.dll. This COM component contains an object ShellWindowsthat you can use to determine if there is a running instance of Internet Explorer or not, for example:

Dim internetExplorerInstances As New ShellWindows()

Dim foundIE As Boolean = False
For Each ie As InternetExplorer In internetExplorerInstances
If ie.Name = "Windows Internet Explorer" Then
        ie.Navigate(ur, &H800)
        foundIE = True
        Exit For
    End If
Next

If Not foundIE Then
    ' Either do nothing or use Process.Start with a new browser instance
End If

, , , .

+1

Source: https://habr.com/ru/post/1530473/


All Articles