when I use popen to get the output of a command, say dir, it will prompt out a console.
however, can I get the output of a command without the appearance of the cons
I needed to solve this for my full screen OpenGL Windows application, but was unable to prevent the console window popping up. Instead, taking back focus after a short delay seems to work well enough to avoid seeing it.
_popen(cmd, "wb");
Sleep(100);
ShowWindow(hWnd, SW_SHOWDEFAULT);
SetForegroundWindow(hWnd);
Update: this apparently doesn't work if the program is launched from Explorer. It is working when launched from Visual Studio.