title: C++ Windows CreateChildProcess - hide/do not show the child process' console window
body: <p>I need to create a child process as a socket listener/server for my main process and I use this call to achieve the goal:</p>
  
  <pre><code>bSuccess = CreateProcessA(NULL, 
              cmdLineArgs,   // command line 
              NULL,          // process security attributes 
              NULL,          // primary thread security attributes 
              TRUE,          // handles are inherited 
              HIGH_PRIORITY_CLASS,             // creation flags 
              NULL,          // use parent's environment 
              NULL,          // use parent's current directory 
              &amp;siStartInfo,  // STARTUPINFO pointer 
              &amp;piProcInfo);  // receives PROCESS_INFORMATION 
  </code></pre>
  
  <p>Could anyone state what needs to be done in order for the child process' window not to show up? It's undesirable to have a visible process window each time the main, central process creates a child. </p>
  
  <p><strong>LATER EDIT</strong> I used:</p>
  
  <pre><code>HWND hWnd = GetConsoleWindow();
  if (hWnd != 0) 
  {       
      ShowWindow( hWnd, SW_HIDE);
  }
  </code></pre>
  
  <p>in the child process main function, but this isn't really the best solution as the window still shows up for a fraction of a second. If one has several child processes, each with its own window bubbling onto the screen, it is still not elegant. Are there any flags to set for the compiler to produce a "console-less" output? </p>
  
  <p>I'm using Visual Studio 2010.</p>