diff --git a/CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.netcore.cs b/CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.netcore.cs index 8b9e33ecf..94723cbdc 100644 --- a/CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.netcore.cs +++ b/CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.netcore.cs @@ -78,6 +78,7 @@ namespace CefSharp.Core public static bool Initialize(CefSharp.Core.CefSettingsBase cefSettings, bool performDependencyCheck) { throw null; } public static bool Initialize(CefSharp.Core.CefSettingsBase cefSettings, bool performDependencyCheck, CefSharp.IApp cefApp) { throw null; } public static bool Initialize(CefSharp.Core.CefSettingsBase cefSettings, bool performDependencyCheck, CefSharp.IBrowserProcessHandler browserProcessHandler) { throw null; } + public static bool IsWindows10OrGreaterEx() { throw null; } public static CefSharp.UrlParts ParseUrl(string url) { throw null; } public static bool PostAction(CefSharp.CefThreadIds threadId, System.Action action) { throw null; } public static bool PostDelayedAction(CefSharp.CefThreadIds threadId, System.Action action, int delayInMs) { throw null; } diff --git a/CefSharp.Core.Runtime/Cef.h b/CefSharp.Core.Runtime/Cef.h index 37c86e199..a408dd423 100644 --- a/CefSharp.Core.Runtime/Cef.h +++ b/CefSharp.Core.Runtime/Cef.h @@ -9,6 +9,7 @@ #include "Stdafx.h" +#include "versionhelpers.h"; #include #include #include @@ -903,6 +904,11 @@ namespace CefSharp return CefPostTask((cef_thread_id_t)threadId, task); } + + static bool IsWindows10OrGreaterEx() + { + return IsWindows10OrGreater(); + } }; } } diff --git a/CefSharp.Core/Cef.cs b/CefSharp.Core/Cef.cs index d1356fb85..1f4eef9ff 100644 --- a/CefSharp.Core/Cef.cs +++ b/CefSharp.Core/Cef.cs @@ -671,5 +671,28 @@ namespace CefSharp { return Core.Cef.PostAction(threadId, action); } + + /// + /// Indicates if the current OS version matches, or is greater than, the Windows 10 version. + /// Applications not manifested for Windows 10 return false, even if the current operating system version is Windows 10. + /// To manifest your applications for Windows 10, see https://learn.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1. + /// + /// True if the current OS version matches, or is greater than, the Windows 10 version; otherwise, false. + public static bool IsWindows10OrGreater() + { + return Core.Cef.IsWindows10OrGreaterEx(); + } + + /// + /// If the current OS version matches, or is greater than, the Windows 10 version then this method does nothing. + /// Applications not manifested for Windows 10 will throw an , even if the current operating system version is Windows 10. + /// To manifest your applications for Windows 10, see https://learn.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1. + /// + /// + public static void AssertIsWindows10OrGreater() + { + if (!IsWindows10OrGreater()) + throw new ApplicationException("Current OS version is less than Windows 10. Applications not manifested for Windows 10 throw this exception, even if the current operating system version is Windows 10. To manifest your applications for Windows 10, see https://learn.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1."); + } } } diff --git a/CefSharp.OffScreen.Example/app.manifest b/CefSharp.OffScreen.Example/app.manifest index b2a08d585..13da1936b 100644 --- a/CefSharp.OffScreen.Example/app.manifest +++ b/CefSharp.OffScreen.Example/app.manifest @@ -33,13 +33,7 @@ - - - - - - - + diff --git a/CefSharp.WinForms.Example/app.manifest b/CefSharp.WinForms.Example/app.manifest index 57db5747d..f4a97890c 100644 --- a/CefSharp.WinForms.Example/app.manifest +++ b/CefSharp.WinForms.Example/app.manifest @@ -39,13 +39,7 @@ - - - - - - - + diff --git a/CefSharp.Wpf.Example/app.manifest b/CefSharp.Wpf.Example/app.manifest index 8f2fe105c..f0066cdf3 100644 --- a/CefSharp.Wpf.Example/app.manifest +++ b/CefSharp.Wpf.Example/app.manifest @@ -40,13 +40,7 @@ - - - - - - - +