From ed5adfc7879ea5d14610b231a2082aa11d5d7cec Mon Sep 17 00:00:00 2001 From: Alex Maitland <amaitland@users.noreply.github.com> Date: Mon, 20 Jun 2022 11:03:18 +1000 Subject: [PATCH] WinForms - Update app.manifest to PerMonitorV2 - Update app.manifest - Update comment in Program.cs --- CefSharp.MinimalExample.WinForms/Program.cs | 5 ++++- CefSharp.MinimalExample.WinForms/app.manifest | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CefSharp.MinimalExample.WinForms/Program.cs b/CefSharp.MinimalExample.WinForms/Program.cs index 280aba3..aaa9a1e 100644 --- a/CefSharp.MinimalExample.WinForms/Program.cs +++ b/CefSharp.MinimalExample.WinForms/Program.cs @@ -19,7 +19,10 @@ namespace CefSharp.MinimalExample.WinForms CefRuntime.SubscribeAnyCpuAssemblyResolver(); #endif - //For Windows 7 and above, best to include relevant app.manifest entries as well + // Programmatically enable DPI Aweness + // Can also be done via app.manifest or app.config + // https://github.com/cefsharp/CefSharp/wiki/General-Usage#high-dpi-displayssupport + // If set via app.manifest this call will have no effect. Cef.EnableHighDPISupport(); var settings = new CefSettings() diff --git a/CefSharp.MinimalExample.WinForms/app.manifest b/CefSharp.MinimalExample.WinForms/app.manifest index 566ab3b..3ae5458 100644 --- a/CefSharp.MinimalExample.WinForms/app.manifest +++ b/CefSharp.MinimalExample.WinForms/app.manifest @@ -33,10 +33,16 @@ </requestedPrivileges> </security> </trustInfo> - + + <!-- + Enable DPI Awareness. + For those targeting .Net 4.7 or greater then configuring via app.config is recommended by Microsoft. + https://docs.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8#configuring-your-windows-forms-app-for-high-dpi-support + --> <asmv3:application> - <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> - <dpiAware>true/PM</dpiAware> + <asmv3:windowsSettings> + <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness> + <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware> </asmv3:windowsSettings> </asmv3:application>