Get full product name for debug info for Windows 11
Make it consistent with earlier version of Windows. Fix #12855, close #12856
This commit is contained in:
parent
e003f5b45f
commit
05977f6308
|
@ -252,10 +252,18 @@ intptr_t CALLBACK DebugInfoDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
|
|||
{
|
||||
swprintf(szProductName, bufSize, TEXT("%s"), (NppParameters::getInstance()).getWinVersionStr().c_str());
|
||||
}
|
||||
|
||||
// Override ProductName if it's Windows 11
|
||||
if (NppDarkMode::isWindows11())
|
||||
swprintf(szProductName, bufSize, TEXT("%s"), TEXT("Windows 11"));
|
||||
else if (NppDarkMode::isWindows11())
|
||||
{
|
||||
generic_string tmpProductName = szProductName;
|
||||
constexpr size_t strLen = 10U;
|
||||
const TCHAR strWin10[strLen + 1U] = TEXT("Windows 10");
|
||||
const size_t pos = tmpProductName.find(strWin10);
|
||||
if (pos < (bufSize - strLen - 1U))
|
||||
{
|
||||
tmpProductName.replace(pos, strLen, TEXT("Windows 11"));
|
||||
swprintf(szProductName, bufSize, TEXT("%s"), tmpProductName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
if (szCurrentBuildNumber[0] == '\0')
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue