Fixes: Issue where standard output was not activated when started from command line.

This commit is contained in:
Adrien Allard committed 2024-03-10 22:31:28 +01:00
1 parent 73a91a14bc
commit 47c425e777
2 files changed
+11 -1

No files matched your search

+10 -1
View File
@@ -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<ApplicationTerminateArgs> 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();
+1
View File
@@ -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