comparison installer-files/octave-launch.c @ 6001:88762923aa9a release

octave-launch: Attach to console of parent process if applicable. * installer-files/octave-launch.c: If parent process has a console, attach to it.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 05 Dec 2021 18:26:51 +0100
parents 1b5d45d7afd4
children 9d6cbb229b0f
comparison
equal deleted inserted replaced
5997:b8d1edf82ec2 6001:88762923aa9a
336 StringCchCopyW (path, PATH_SZ, binpath); 336 StringCchCopyW (path, PATH_SZ, binpath);
337 337
338 StringCchCopyW (argbuffer, ARGBUF_SZ, L"octave.exe "); 338 StringCchCopyW (argbuffer, ARGBUF_SZ, L"octave.exe ");
339 StringCchCatW (path, PATH_SZ, L"\\octave.exe"); 339 StringCchCatW (path, PATH_SZ, L"\\octave.exe");
340 340
341 /* If parent process has a console, attach to it.
342 Let the function fail silently, when parent has no console
343 (e.g., when program has been started from link in start menu).
344 No console will be shown in this case. */
345 AttachConsole (ATTACH_PARENT_PROCESS);
346
341 if (! (no_gui_libs || no_gui_arg_found)) 347 if (! (no_gui_libs || no_gui_arg_found))
342 { 348 {
343 /* Unless --no-gui or --no-gui-libs is specified, we will use a GUI window. */ 349 /* Unless --no-gui or --no-gui-libs is specified, we will use a GUI window. */
344 si.dwFlags = STARTF_USESHOWWINDOW; 350 si.dwFlags = STARTF_USESHOWWINDOW;
345 351