title: C++ run program in background Windows 10
body: <p>I am trying to run an executable in background written in C++ in Windows 10. The program does not have any GUI. I tried this </p>
  
  <pre><code>window = FindWindowA("ConsoleWindowClass", NULL);
  ShowWindow(window,0);
  </code></pre>
  
  <p>But although it does work on Windows 7 and opens and instantly closes the console, and the executable runs in background, on Windows 10 it opens a console and the console stays open. If I run the .exe with <code>run /B main.exe</code> I have to keep the console open in order for the program to keep running, and if I close the cmd console execution stops.</p>
  
  <p>Is there a way to programatically run the file in background? I am aware that I can run it in background using vbscript, but I would like to avoid that.</p>