diff --git a/Application/FileConverter/Application.xaml.cs b/Application/FileConverter/Application.xaml.cs index 78487ce..4d5181b 100644 --- a/Application/FileConverter/Application.xaml.cs +++ b/Application/FileConverter/Application.xaml.cs @@ -19,6 +19,7 @@ namespace FileConverter using System.Collections.Generic; using System.Diagnostics; using System.IO; + using System.Runtime.InteropServices; using System.Security.Principal; using System.Threading; using System.Windows; @@ -47,7 +48,12 @@ namespace FileConverter private bool verbose; private bool showSettings; private bool showHelp; - + + [DllImport("kernel32.dll")] + static extern bool AttachConsole(uint dwProcessId); + + const uint ATTACH_PARENT_PROCESS = 0x0ffffffff; + public event EventHandler OnApplicationTerminate; public static Version ApplicationVersion => Application.Version; @@ -78,6 +84,9 @@ namespace FileConverter protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); + + // Redirect standard output to the parent process in case the application is launch from command line. + AttachConsole(ATTACH_PARENT_PROCESS); this.RegisterServices(); diff --git a/CHANGELOG.md b/CHANGELOG.md index cf3c0cb..d3cbb0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - New: Tempo and pitch conversion presets in default settings (github issue #18). - Fixes: Issue where newly supported input types (ts, heic, ...) were not used in presets (github issue #388). +- Fixes: Issue where standard output was not activated when started from command line. ## Version 2.0