title: Getting the current tab's URL from Google Chrome using C#
body: <p>There used to be a way to get the active tab's URL from Google Chrome by using <code>FindWindowEx</code> in combination with a <code>SendMessage</code> call to get the text currently in the omnibox. A recent (?) update seems to have broken this method, since Chrome seems to be rendering everything itself now. (You can check with Spy++, AHK Window Spy or Window Detective)</p>
  
  <p>To get the current URL on Firefox and Opera, you can use DDE and <code>WWW_GetWindowInfo</code>. This doesn't seem to be possible on Chrome (anymore?).</p>
  
  <p><a href="https://stackoverflow.com/questions/430614/get-firefox-url">This question</a> has an answer with more info about how it used to work, which is this piece of code (which, as I explained, doesn't work anymore - <code>hAddressBox</code> is <code>0</code>):</p>
  
  <pre><code>var hAddressBox = FindWindowEx(
      intPtr,
      IntPtr.Zero,
      "Chrome_OmniboxView",
      IntPtr.Zero);
  
  var sb = new StringBuilder(256);
  SendMessage(hAddressBox, 0x000D, (IntPtr)256, sb);
  temp = sb.ToString();
  </code></pre>
  
  <p>So my question is: Is there a <em>new</em> way to get the currently focused tab's URL? (Just the title is not enough)</p>