title: Process JavaScript-generated page in BHO
body: <p>I'm developing a <code>BHO</code> and need to process page content on <code>OnDocumentComplete</code> event.
  But I found a problem - there are no page content at that moment, because it is generated later by <code>JavaScript</code>.
  <p>I was trying to call myself by using Navigate method with JavaScript function that must call me, but without any success.
  I've searched by keywords <a href="/questions/tagged/bho" class="post-tag" title="show questions tagged &#39;bho&#39;" rel="tag">bho</a>, <a href="/questions/tagged/internet-explorer" class="post-tag" title="show questions tagged &#39;internet-explorer&#39;" rel="tag">internet-explorer</a>, <a href="/questions/tagged/javascript" class="post-tag" title="show questions tagged &#39;javascript&#39;" rel="tag">javascript</a> and found no useful results.
  <p>Thanks for any advices.
  <p><strong>EDIT1:</strong>
  Creating a new thread and passing into it pointer to <code>this</code> works fine in development environment, but cause crashes on real system.
  <p><strong>EDIT2:</strong>
  Today's workaround - IE tool-bar button <code>IOleCommandTarget::Exec</code> method calls page parsing code. But it requires user interaction.
  <p><strong>EDIT3:</strong>
  New workaround - in <code>FinalConstruct</code> I create my own <strong>window</strong>. If template search fails I create new <strong>thread</strong>, that sleeps some seconds and sends <code>WM_USER</code> message to that window. Window procedure calls page parser.</p>