From 8799001ee37450b53234bdacc73002e425b53f29 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sat, 10 Mar 2012 21:25:17 +0000 Subject: [PATCH] Prevent window from being created by python ct2ctml subprocess When using Cantera from a GUI app, the python process was inheriting window settings from the parent, and launching in a window that didn't accept input from the calling process, causing the conversion to fail. --- ext/libexecstream/win/exec-stream-impl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/libexecstream/win/exec-stream-impl.cpp b/ext/libexecstream/win/exec-stream-impl.cpp index 42b8805c0..0add2045d 100644 --- a/ext/libexecstream/win/exec-stream-impl.cpp +++ b/ext/libexecstream/win/exec-stream-impl.cpp @@ -166,9 +166,11 @@ void exec_stream_t::start( std::string const & program, std::string const & argu STARTUPINFO si; ZeroMemory( &si, sizeof( si ) ); si.cb=sizeof( si ); + si.wShowWindow = SW_HIDE; + si.dwFlags = STARTF_USESHOWWINDOW; PROCESS_INFORMATION pi; ZeroMemory( &pi, sizeof( pi ) ); - if( !CreateProcess( 0, const_cast< char * >( command.c_str() ), 0, 0, TRUE, 0, 0, 0, &si, &pi ) ) { + if( !CreateProcess( 0, const_cast< char * >( command.c_str() ), 0, 0, TRUE, DETACHED_PROCESS, 0, 0, &si, &pi ) ) { throw os_error_t( "exec_stream_t::start: CreateProcess failed.\n command line was: "+command ); }