Recently boost 1.64 released, including boost::process. This provides an easy interface for starting processes. Previously I used the stand-alone version of the boost::process library (see here). This worked well. I would like to change to the new edition so I can drop the stand-alone dependency.
The API is a bit different but everything works fine, except for on thing. In the old version I was able to pass a windows-specific context object which allowed me the hide any console windows openened by the process.
boost::process::win32_context ctx;
ctx.environment = boost::process::self::get_environment();
STARTUPINFOA stup;
ZeroMemory(&stup, sizeof(stup));
stup.cb = sizeof(stup);
stup.dwFlags = STARTF_USESHOWWINDOW;
stup.wShowWindow = SW_HIDE;
ctx.startupinfo = &stup;
std::vector<std::string> args;
boost::process:child process = boost::process::win32_launch("myprogram", args, ctx);
Using the new version it looks like this:
boost::process::environment env = boost::this_process::environment();
boost::process:child process(boost::filesystem::path("myprogram"), env);
Everything works fine except for hiding the console window. Is it possible to achieve this?