title: how to retrieve URL from browser using c#
body: <p>I am working on a windows application using c# . I want to retrieve URL from browser. but i am unable to do this .</p>
  
  <pre><code>private void WebListLoad()
  {
      ListViewItem lvi;
      Process[] prs = Process.GetProcessesByName("firefox");
      try
      {
  
      //int handle = int.Parse(Console.ReadLine(), NumberStyles.HexNumber);
      //int txtLength = SendMessage(handle, WM_GETTEXTLENGTH, 0, 0);
      //StringBuilder sb = new StringBuilder(txtLength + 1);
      //SendMessage(handle, WM_GETTEXT, sb.Capacity, sb);
  
  
          foreach (Process proces in prs)
          {
              if (proces.MainWindowTitle.Length &gt; 0)
              {
                  lvi = listView2.Items.Add(System.Environment.UserName);
                  lvi.SubItems.Add("");
                  lvi.SubItems.Add(proces.MainWindowTitle.ToString());
                  lvi.SubItems.Add(proces.StartTime.ToString());
              }
          }
      }
      catch
      {
      }
  }
  </code></pre>