title: Get the URLs of opened tabs in Chrome .Net
body: <p>Hello Can help with this code</p>
  
  <p>i try to get all chrome tab's Url and insert them in listbox</p>
  
  <p>, the project already run without any Error.</p>
  
  <p>Code Form 1 :</p>
  
  <pre><code>Imports System.Runtime.InteropServices
  Imports NDde.Client
  
  Public Class Form1
  
  &lt;DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)&gt;
  Private Shared Function FindWindow(
  ByVal lpClassName As String,
  ByVal lpWindowName As String) As IntPtr
  End Function
  
  &lt;DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)&gt;
  Private Shared Function FindWindowEx(ByVal parentHandle As IntPtr,
                ByVal childAfter As IntPtr,
                ByVal lclassName As String,
                ByVal windowTitle As String) As IntPtr
  End Function
  
  &lt;DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)&gt;
  Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
  End Function
  
  Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  
  End Sub
  
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      Dim h As IntPtr
      For Each p As Process In Process.GetProcessesByName("chrome")
          h = FindWindow("Chrome_WidgetWin_1", p.MainWindowTitle)
          Exit For
      Next
      Dim urlH As IntPtr
      urlH = FindWindowEx(h, 0, "Chrome_OmniboxView", Nothing)
      Dim urlHH As IntPtr = Marshal.AllocHGlobal(100)
      Dim NumText As Integer = SendMessage(urlH, &amp;HD, 50, urlHH)
      Dim url As String = Marshal.PtrToStringUni(urlHH)
      ListBox1.Items.Add(url)
  End Sub
  End Class
  </code></pre>
  
  <p>The Error : <a href="https://i.stack.imgur.com/WnGhG.png" rel="nofollow noreferrer">Error Issue</a></p>