title: How to execute child console programs without showing the console window from the Win32 GUI program?
body: <p>(I've searched SO answers and found no clear solution to this problem.)</p>
  
  <p>I'm working on a MFC GUI program. This program runs various child programs including console program and shell command script(.cmd).</p>
  
  <p>Initially it displayed one GUI window and one console window (created with <code>AllocConsole</code>) because there are many console output from the child processes. But many users complained about the console window so we decided to hide the console window.</p>
  
  <p>Firstly tried like below:  </p>
  
  <pre><code>if (AllocConsole())
  {
      ::ShowWindow(::GetConsoleWindow(), SW_HIDE);
  }
  </code></pre>
  
  <p>Okay, no console window but there are visible flicker at the console creation time.
  I've tried several <code>CreateProcess</code> options for child process creation to prevent showing of console window altogether but failed at short and I think it is practically impossible.</p>
  
  <p>It is not a big deal. We can ignore temporary window flicker at the startup.</p>
  
  <p>But is it really impossible to hide child console window completely?</p>