mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #3465 from RaiKoHoff/Dev_RC1
Win10 Release-ID as string (allows 20H2 or 21H1)
This commit is contained in:
commit
f0e2c0eeb1
@ -5899,11 +5899,9 @@ static void _ShowZeroLengthCallTip(DocPos iPosition)
|
||||
//
|
||||
static bool _EnableFRDlgCtrls(HWND hwnd) {
|
||||
|
||||
//bool const bEmptyFnd = (ComboBox_GetTextLengthEx(hwnd, IDC_FINDTEXT) == 0 || ComboBox_GetCurSelEx(hwnd, IDC_FINDTEXT) != CB_ERR);
|
||||
//bool const bEmptyRpl = (ComboBox_GetTextLengthEx(hwnd, IDC_REPLACETEXT) == 0 || ComboBox_GetCurSelEx(hwnd, IDC_REPLACETEXT) != CB_ERR);
|
||||
bool const bEmptyFnd = ComboBox_GetTextLengthEx(hwnd, IDC_FINDTEXT) == 0;
|
||||
bool const bEmptyRpl = ComboBox_GetTextLengthEx(hwnd, IDC_REPLACETEXT) == 0;
|
||||
bool const bEmptySel = !(SciCall_IsSelectionEmpty() || Sci_IsMultiOrRectangleSelection());
|
||||
bool const bEmptyFnd = ComboBox_GetTextLengthEx(hwnd, IDC_FINDTEXT) == 0 /*|| ComboBox_GetCurSelEx(hwnd, IDC_FINDTEXT) != CB_ERR)*/;
|
||||
bool const bEmptyRpl = ComboBox_GetTextLengthEx(hwnd, IDC_REPLACETEXT) == 0 /*|| ComboBox_GetCurSelEx(hwnd, IDC_REPLACETEXT) != CB_ERR)*/;
|
||||
bool const bEmptySel = (SciCall_IsSelectionEmpty() || Sci_IsMultiOrRectangleSelection());
|
||||
|
||||
DialogEnableControl(hwnd, IDOK, !bEmptyFnd);
|
||||
DialogEnableControl(hwnd, IDC_FINDPREV, !bEmptyFnd);
|
||||
|
||||
@ -213,36 +213,38 @@ static void _GetTrueWindowsVersion()
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// https://docs.microsoft.com/en-us/windows/release-health/release-information
|
||||
// https://docs.microsoft.com/en-US/windows/release-health/release-information
|
||||
// ----------------------------------------------------------------------------
|
||||
static DWORD _Win10BuildToReleaseId(DWORD build)
|
||||
{
|
||||
if (build >= 21390) {
|
||||
return 2109;
|
||||
} else if (build >= 19043) {
|
||||
return 2104;
|
||||
} else if (build >= 19042) {
|
||||
return 2009;
|
||||
} else if (build >= 19041) {
|
||||
return 2004;
|
||||
} else if (build >= 18363) {
|
||||
return 1909;
|
||||
} else if (build >= 18362) {
|
||||
return 1903;
|
||||
} else if (build >= 17763) {
|
||||
return 1809;
|
||||
} else if (build >= 17134) {
|
||||
return 1803;
|
||||
} else if (build >= 16299) {
|
||||
return 1709;
|
||||
} else if (build >= 15063) {
|
||||
return 1809;
|
||||
} else if (build >= 14393) {
|
||||
return 1607;
|
||||
} else if (build >= 10586) {
|
||||
return 1511;
|
||||
static LPCWSTR _Win10BuildToReleaseId(DWORD build) {
|
||||
|
||||
static LPCWSTR _wchpReleaseID = L"1507"; // <= 10240
|
||||
|
||||
if (build > 19043) {
|
||||
_wchpReleaseID = L"21H2 [Insdr]";
|
||||
} else if (build > 19042) {
|
||||
_wchpReleaseID = L"21H1";
|
||||
} else if (build > 19041) {
|
||||
_wchpReleaseID = L"20H2";
|
||||
} else if (build > 18363) {
|
||||
_wchpReleaseID = L"2004";
|
||||
} else if (build > 18362) {
|
||||
_wchpReleaseID = L"1909";
|
||||
} else if (build > 17763) {
|
||||
_wchpReleaseID = L"1903 [EoS]";
|
||||
} else if (build > 17134) {
|
||||
_wchpReleaseID = L"1809";
|
||||
} else if (build > 16299) {
|
||||
_wchpReleaseID = L"1803 [EoS]";
|
||||
} else if (build > 15063) {
|
||||
_wchpReleaseID = L"1709 [EoS]";
|
||||
} else if (build > 14393) {
|
||||
_wchpReleaseID = L"1703 [EoS]";
|
||||
} else if (build > 10586) {
|
||||
_wchpReleaseID = L"1607";
|
||||
} else if (build > 10240) {
|
||||
_wchpReleaseID = L"1511 [EoS]";
|
||||
}
|
||||
return 0; // 10240
|
||||
return _wchpReleaseID;
|
||||
}
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@ -266,7 +268,7 @@ void GetWinVersionString(LPWSTR szVersionStr, size_t cchVersionStr)
|
||||
|
||||
if (IsWindows10OrGreater()) {
|
||||
WCHAR win10ver[80] = { L'\0' };
|
||||
StringCchPrintf(win10ver, COUNTOF(win10ver), L" Version %i (Build %i)",
|
||||
StringCchPrintf(win10ver, COUNTOF(win10ver), L" Version %s (Build %lu)",
|
||||
_Win10BuildToReleaseId(Globals.WindowsBuildNumber), Globals.WindowsBuildNumber);
|
||||
StringCchCat(szVersionStr, cchVersionStr, win10ver);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user