title: How do I launch a process and obtain its output?
body: <p>In the C language using the Windows API, how can I get the output of a process when I have its process information?</p>
  
  <p>I have code like this:</p>
  
  <pre><code>STARTUPINFO si1;
  ZeroMemory(&amp;si1,sizeof(si1));
  PROCESS_INFORMATION pi1;
  ZeroMemory(&amp;pi1,sizeof(pi1));
  BOOL bRes1=CreateProcess(_T("C:\\User\\asd.exe"),cmd_line1,NULL,NULL,FALSE,CREATE_NO_WINDOW,NULL,NULL, &amp;si1,&amp;pi1); 
  </code></pre>
  
  <p>and the process asd.exe prints a certain output, I want to get it to my process(the one i used the code above in).</p>