Skip to content

Commit

Permalink
chore: use the windows api to get the system version.
Browse files Browse the repository at this point in the history
  • Loading branch information
NaBian committed Jul 6, 2024
1 parent 6a7aa9c commit 01f50c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/Shared/HandyControl_Shared/Controls/Window/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using HandyControl.Tools;
using HandyControl.Tools.Extension;
using HandyControl.Tools.Interop;
using HandyControl.Tools.Helper;

#if NET40
using Microsoft.Windows.Shell;
#else
Expand Down Expand Up @@ -63,8 +65,8 @@ public Window()
{
UseAeroCaptionButtons = false
};
// if below Win11 22H2
if (Environment.OSVersion.Version < new Version(10, 0, 22621, 0))

if (SystemHelper.GetSystemVersionInfo() < SystemVersionInfo.Windows11_22H2)
{
chrome.GlassFrameThickness = new Thickness(0, 0, 0, 1);
chrome.CornerRadius = new CornerRadius();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ namespace HandyControl.Data;
public readonly struct SystemVersionInfo
{
public static SystemVersionInfo Windows10 => new(10, 0, 10240);

public static SystemVersionInfo Windows10_1809 => new(10, 0, 17763);

public static SystemVersionInfo Windows10_1903 => new(10, 0, 18362);
public static SystemVersionInfo Windows11_22H2 => new(10, 0, 22621);

public SystemVersionInfo(int major, int minor, int build)
{
Expand Down

0 comments on commit 01f50c5

Please sign in to comment.