mirror of
https://github.com/Tichau/FileConverter.git
synced 2026-11-26 04:21:10 +01:00
Fixes: Issue where standard output was not activated when started from command line.
This commit is contained in:
1 parent
73a91a14bc
commit
47c425e777
2 files changed
+11
-1
No files matched your search
@@ -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();
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user