new screenshot

This commit is contained in:
Frank Skare
2019-10-09 07:05:46 +02:00
parent 327a097bcf
commit f5e0c92824
5 changed files with 95 additions and 90 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

View File

@@ -66,7 +66,9 @@ namespace mpvnet
return;
}
if (App.IsStartedFromTerminal) Native.AttachConsole(-1 /*ATTACH_PARENT_PROCESS*/);
if (App.IsStartedFromTerminal)
Native.AttachConsole(-1 /*ATTACH_PARENT_PROCESS*/);
Application.Run(new MainForm());
if (App.IsStartedFromTerminal) Native.FreeConsole();
mutex.Dispose();

View File

@@ -10,7 +10,7 @@ public class MediaInfo : IDisposable
{
if (!Loaded)
{
if (LoadLibrary("MediaInfo.dll") == IntPtr.Zero)
if (Native.LoadLibrary("MediaInfo.dll") == IntPtr.Zero)
throw new Exception("Failed to load MediaInfo.dll.");
Loaded = true;
@@ -56,21 +56,27 @@ public class MediaInfo : IDisposable
~MediaInfo() { Dispose(); }
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
static extern IntPtr LoadLibrary(string path);
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string path);
[DllImport("MediaInfo.dll")]
static extern IntPtr MediaInfo_New();
[DllImport("MediaInfo.dll")]
static extern void MediaInfo_Delete(IntPtr handle);
[DllImport("MediaInfo.dll", CharSet = CharSet.Unicode)]
static extern int MediaInfo_Open(IntPtr handle, string path);
[DllImport("MediaInfo.dll", CharSet = CharSet.Unicode)]
static extern int MediaInfo_Open(IntPtr handle, string fileName);
static extern IntPtr MediaInfo_Option(IntPtr handle, string optionString, string value);
[DllImport("MediaInfo.dll")]
static extern IntPtr MediaInfo_Inform(IntPtr handle, int reserved);
[DllImport("MediaInfo.dll")]
static extern int MediaInfo_Close(IntPtr handle);
[DllImport("MediaInfo.dll")]
static extern void MediaInfo_Delete(IntPtr handle);
[DllImport("MediaInfo.dll", CharSet = CharSet.Unicode)]
static extern IntPtr MediaInfo_Get(IntPtr handle,
MediaInfoStreamKind streamKind,

View File

@@ -2,8 +2,6 @@
using System.Drawing;
using System.Runtime.InteropServices;
namespace mpvnet
{
public class Native
{
[DllImport("kernel32.dll")]
@@ -13,7 +11,7 @@ namespace mpvnet
public static extern bool FreeConsole();
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string dllToLoad);
public static extern IntPtr LoadLibrary(string path);
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle);
@@ -95,4 +93,3 @@ namespace mpvnet
public string lpData;
}
}
}

View File

@@ -16,7 +16,7 @@ using System.Windows.Forms;
using WinForms = System.Windows.Forms;
using static mpvnet.libmpv;
using static mpvnet.Native;
using static Native;
namespace mpvnet
{