title: ShowWindowAsync doesn't activate a hidden+minimized window?
body: <p>A given external (not owned by the current process) window (<code>hWnd</code>) is first minimized, then hidden:</p>
  
  <pre><code>ShowWindowAsync(hWnd, SW_MINIMIZE);
  // wait loop inserted here
  ShowWindowAsync(hWnd, SW_HIDE);
  </code></pre>
  
  <p>The following call properly restores it to the un-minimized (restored) state:</p>
  
  <pre><code>ShowWindow(hWnd, SW_RESTORE);
  </code></pre>
  
  <p>However, this call does not:</p>
  
  <pre><code>ShowWindowAsync(hWnd, SW_RESTORE);
  </code></pre>
  
  <p>In the second instance with <code>ShowWindowAsync()</code>, the window is un-minimized and no longer hidden, but it is not activated (remains behind other existing windows). Conversely, the first <code>ShowWindow()</code> call correctly activates the window.</p>
  
  <p>Is this expected behavior? <strong>How can I restore the window (to the foreground) without relying on <code>ShowWindow()</code>, which is synchronous (blocking)?</strong> (The wait loop in the example can have a timeout, while <code>ShowWindow()</code> does not allow specification of a timeout.)</p>
  
  <p>(WinXP SP3)</p>