how to run a c++ program in the background

C++
HWND window;
AllocConsole();
window = FindWindowA("ConsoleWindowClass", NULL);
ShowWindow(window,0);
Source

Also in C++: