-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1040 from reupen/windows-11-systray-ampersand
Work around different handling of ampersands in Windows 11 system tray
- Loading branch information
Showing
7 changed files
with
62 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "pch.h" | ||
|
||
namespace cui::win32 { | ||
|
||
bool check_windows_10_build(DWORD build_number) | ||
{ | ||
OSVERSIONINFOEX osviex{}; | ||
osviex.dwOSVersionInfoSize = sizeof(osviex); | ||
|
||
DWORDLONG mask = VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL); | ||
mask = VerSetConditionMask(mask, VER_MINORVERSION, VER_GREATER_EQUAL); | ||
mask = VerSetConditionMask(mask, VER_BUILDNUMBER, VER_GREATER_EQUAL); | ||
|
||
osviex.dwMajorVersion = 10; | ||
osviex.dwMinorVersion = 0; | ||
osviex.dwBuildNumber = build_number; | ||
|
||
return VerifyVersionInfoW(&osviex, VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER, mask) != FALSE; | ||
} | ||
|
||
bool is_windows_11_rtm_or_newer() | ||
{ | ||
static auto is_22000_or_newer = check_windows_10_build(22'000); | ||
return is_22000_or_newer; | ||
} | ||
|
||
} // namespace cui::win32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
|
||
namespace cui::win32 { | ||
|
||
bool check_windows_10_build(DWORD build_number); | ||
bool is_windows_11_rtm_or_newer(); | ||
|
||
} // namespace cui::win32 |