-
-
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.
Work around different handling of system tray ampersands in Windows 11
Windows 11 handles ampersands in system tray icon tooltips differently from earlier versions of Windows. Microsoft has shown no interest in fixing the problem (or even accepting that the problem exists), therefore this adds a nasty `if <is windows 11>` to work around the problem.
- 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 |