title: How to get the same application instance handle from QT and WinApi
body: <p>My QT application uses WinApi library.
  Now I have the following code:</p>
  
  <pre><code>//main.cpp
  qDebug() &lt;&lt; "main::instance = " &lt;&lt; qApp; //0x29fe18
  //lib.cpp
  qDebug() &lt;&lt; "library::instance = " &lt;&lt; GetModuleHandle(NULL); // 0x400000
  </code></pre>
  
  <p>As you see, I'm getting different handles while my app has only one thread flow.</p>
  
  <p>What's wrong?</p>
  
  <p><strong><em>Edit:</em></strong> 
  Yes, I guessed that those are kind of different things.
  Question is: how do I get thread handle from both places (if code running from the same thread - I should get the same handle value, if there's 2 threads - I should get 2 different thread handles)?</p>