diff --git a/Ninjacrab.PersistentWindows.Solution/Common/DbKeySelect.cs b/Ninjacrab.PersistentWindows.Solution/Common/DbKeySelect.cs index 3447a37..b79d4fd 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/DbKeySelect.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/DbKeySelect.cs @@ -12,7 +12,7 @@ namespace PersistentWindows.Common public DbKeySelect() { - User32.SetThreadDpiAwarenessContextSafe(User32.DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + User32.SetThreadDpiAwarenessContextSafe(); InitializeComponent(); } diff --git a/Ninjacrab.PersistentWindows.Solution/Common/LaunchProcess.cs b/Ninjacrab.PersistentWindows.Solution/Common/LaunchProcess.cs index 4c5098f..ff660c9 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/LaunchProcess.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/LaunchProcess.cs @@ -12,7 +12,7 @@ namespace PersistentWindows.Common public LaunchProcess(string process, string title) { - User32.SetThreadDpiAwarenessContextSafe(User32.DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + User32.SetThreadDpiAwarenessContextSafe(); InitializeComponent(); diff --git a/Ninjacrab.PersistentWindows.Solution/Common/LayoutProfile.cs b/Ninjacrab.PersistentWindows.Solution/Common/LayoutProfile.cs index 897836a..0a17cff 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/LayoutProfile.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/LayoutProfile.cs @@ -11,7 +11,7 @@ namespace PersistentWindows.Common public LayoutProfile() { - User32.SetThreadDpiAwarenessContextSafe(User32.DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + User32.SetThreadDpiAwarenessContextSafe(); InitializeComponent(); } diff --git a/Ninjacrab.PersistentWindows.Solution/Common/NameDbKey.cs b/Ninjacrab.PersistentWindows.Solution/Common/NameDbKey.cs index 2bdfb2d..07edd95 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/NameDbKey.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/NameDbKey.cs @@ -10,7 +10,7 @@ namespace PersistentWindows.Common public string db_entry_name = null; public NameDbEntry() { - User32.SetThreadDpiAwarenessContextSafe(User32.DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + User32.SetThreadDpiAwarenessContextSafe(); InitializeComponent(); } diff --git a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs index b4bbff0..d161d31 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs @@ -204,7 +204,7 @@ namespace PersistentWindows.Common } catch (Exception) { - User32.SetThreadDpiAwarenessContextSafe(User32.DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + User32.SetThreadDpiAwarenessContextSafe(); System.Windows.Forms.MessageBox.Show("Another instance is already running.", productName, System.Windows.Forms.MessageBoxButtons.OK, @@ -719,7 +719,7 @@ namespace PersistentWindows.Common sessionActive = false; // no new capture pauseAutoRestore = true; - User32.SetThreadDpiAwarenessContextSafe(User32.DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + User32.SetThreadDpiAwarenessContextSafe(); System.Windows.Forms.MessageBox.Show("Proceed to restore windows", System.Windows.Forms.Application.ProductName, diff --git a/Ninjacrab.PersistentWindows.Solution/Common/WinApiBridge/User32.cs b/Ninjacrab.PersistentWindows.Solution/Common/WinApiBridge/User32.cs index bbfb1a0..d76ad58 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/WinApiBridge/User32.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/WinApiBridge/User32.cs @@ -454,7 +454,7 @@ namespace PersistentWindows.Common.WinApiBridge public const int DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = -3; public const int DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = -4; public const int DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED = -5; - public static int SetThreadDpiAwarenessContextSafe(int dpi_awareness_cxt) + public static int SetThreadDpiAwarenessContextSafe(int dpi_awareness_cxt = DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) { var os_version = Environment.OSVersion; if (os_version.Version.Major < 10)