title: Give focus to Internet Explorer object created through C#
body: <p>I'm having some problems with the control of IE through C#.
  I have almost everything managed.
  But I can't seem to set the focus to opened explorer.
  When I'm in VS 2010 it works, but this isn't the case when I run the exe file directly.</p>
  
  <pre><code>using SHDocVw;
  .
  
  &lt;code&gt;
  
  .
  InternetExplorer ie = new InternetExplorer();
  IWebBrowserApp wb = (IWebBrowserApp)ie;
  .
  
  &lt;code&gt;
  
  .   
  wb.Visible = true;
  wb.Document.focus();
  </code></pre>
  
  <p>I mean that <code>wb.Document.focus();</code> would give focus to IE, but that dosen't work.
  Have also tried with <code>eb.Document.focus();</code>
  Anyone have a sugestion?</p>