diff --git a/ColorControl/ColorControl.csproj b/ColorControl/ColorControl.csproj index d7ff0cd..2c33512 100644 --- a/ColorControl/ColorControl.csproj +++ b/ColorControl/ColorControl.csproj @@ -18,8 +18,8 @@ Maassoft Maassoft 0 - 9.8.0.0 - 9.8.0.0 + 9.8.0.1 + 9.8.0.1 false true false diff --git a/ColorControl/XForms/ColorProfileViewModel.cs b/ColorControl/XForms/ColorProfileViewModel.cs index 4a63820..223ba10 100644 --- a/ColorControl/XForms/ColorProfileViewModel.cs +++ b/ColorControl/XForms/ColorProfileViewModel.cs @@ -2,8 +2,9 @@ using ColorControl.Shared.Forms; using ColorControl.Shared.Native; using ColorControl.Shared.XForms; +using EDIDParser; using MHC2Gen; -using novideo_srgb; +using Microsoft.Win32; using System; using System.Collections.Generic; using System.ComponentModel; @@ -231,7 +232,7 @@ private void GetEDID() var path = SelectedDisplay.DevicePath; - var edid = Novideo.GetEDID(path, null); + var edid = GetEDIDInternal(path); var primaries = edid?.DisplayParameters?.ChromaticityCoordinates; if (primaries == null) @@ -257,4 +258,19 @@ internal RgbPrimaries GetDevicePrimaries() new CIExy { x = BluePoint.X, y = BluePoint.Y }, new CIExy { x = WhitePoint.X, y = WhitePoint.Y }); } + + private static EDID GetEDIDInternal(string path) + { + try + { + var registryPath = "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Enum\\DISPLAY\\"; + registryPath += string.Join("\\", path.Split('#').Skip(1).Take(2)); + return new EDID((byte[])Registry.GetValue(registryPath + "\\Device Parameters", "EDID", null)); + } + catch + { + return null; + } + } + } diff --git a/ColorControl/XForms/ColorProfileWindow.xaml.cs b/ColorControl/XForms/ColorProfileWindow.xaml.cs index dda1500..e133edc 100644 --- a/ColorControl/XForms/ColorProfileWindow.xaml.cs +++ b/ColorControl/XForms/ColorProfileWindow.xaml.cs @@ -41,7 +41,7 @@ public static void CreateAndShow(bool show = true) { if (Application.Current == null) { - new Application(); + new Application { ShutdownMode = ShutdownMode.OnExplicitShutdown }; } var window = Program.ServiceProvider.GetRequiredService(); diff --git a/LittleCms/lcms2.dll b/LittleCms/lcms2.dll index a1e2539..2067c1b 100644 Binary files a/LittleCms/lcms2.dll and b/LittleCms/lcms2.dll differ