title: possible to have a Timeout on ReadFile()?
body: <pre><code>while(GetExitCodeProcess(processInfo.hProcess, &amp;exitCode)
          &amp;&amp; exitCode == STILL_ACTIVE)
  {
      ReadFile(defaultSTDIN, chBuf, 1, &amp;dwRead, 0);
      WriteFile(writingEnd, chBuf, 1, &amp;dwWritten, 0);
  }
  </code></pre>
  
  <p>The problem with the code above is that even when the child process referenced through processInfo.hProcess has exited, we are still stuck in the while loop because ReadFile() is waiting for input. Whats the best way to solve this? </p>