From fa32e0c6d33792861fa4a7fac83f5bf987d1ac3d Mon Sep 17 00:00:00 2001 From: RadAd Date: Tue, 6 Jul 2021 16:37:01 +1000 Subject: Update to latest VS2019 --- RadTerminal.cpp | 7 +++++-- RadTerminal.vcxproj | 4 ++-- RadTerminalFrame.cpp | 19 +++++++++++++++++-- tsm.vcxproj | 10 +++++----- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/RadTerminal.cpp b/RadTerminal.cpp index 591e87f..f0b4cc5 100644 --- a/RadTerminal.cpp +++ b/RadTerminal.cpp @@ -163,11 +163,12 @@ RadTerminalCreate GetTerminalCreate(bool bParseCmdLine, std::tstring profile) RadTerminalCreate rtc = {}; rtc.iFontHeight = 16; rtc.strFontFace = _T("Consolas"); + //rtc.strFontFace = _T("Cascadia Code"); //rtc.strScheme = _T("solarized"); rtc.szCon = { 80, 25 }; rtc.sb = 1000; - //rtc.strCmd = _T("%COMSPEC%"); - //rtc.strCmd = _T("cmd"); + //rtc.strCommand = _T("%COMSPEC%"); + rtc.strCommand = _T("cmd"); LoadRegistry(rtc, _T("Default")); LoadRegistry(rtc, profile.c_str()); @@ -180,6 +181,8 @@ RadTerminalCreate GetTerminalCreate(bool bParseCmdLine, std::tstring profile) int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, PTSTR pCmdLine, int nCmdShow) { InitDarkMode(); + //SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_SYSTEM_AWARE); + //SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED); HWND hWnd = NULL; HWND hWndMDIClient = NULL; diff --git a/RadTerminal.vcxproj b/RadTerminal.vcxproj index 7efcf80..1d1df6f 100644 --- a/RadTerminal.vcxproj +++ b/RadTerminal.vcxproj @@ -22,12 +22,12 @@ {5660720B-5A4B-4F82-85C3-AE789F685218} Win32Proj RadTerminal - 10.0.17763.0 + 10.0 Application - v140 + v142 Unicode diff --git a/RadTerminalFrame.cpp b/RadTerminalFrame.cpp index 58a7563..eed6274 100644 --- a/RadTerminalFrame.cpp +++ b/RadTerminalFrame.cpp @@ -70,9 +70,8 @@ BOOL RadTerminalFrameOnCreate(HWND hWnd, LPCREATESTRUCT lpCreateStruct) if (RegOpenKey(HKEY_CURRENT_USER, REG_BASE TEXT("\\Profiles"), &hMainKey) == ERROR_SUCCESS) { const std::tstring strDefault = RegGetString(HKEY_CURRENT_USER, REG_BASE, TEXT("Profile"), TEXT("Cmd")); - DWORD i = 0; std::tstring strName; - for (int i = 0; RegEnumKeyEx(hMainKey, i, strName); ++i) + for (DWORD i = 0; RegEnumKeyEx(hMainKey, i, strName); ++i) { data->profiles.push_back(strName); if (strName != TEXT("Default")) @@ -91,6 +90,22 @@ BOOL RadTerminalFrameOnCreate(HWND hWnd, LPCREATESTRUCT lpCreateStruct) DeleteMenu(hMenu, ID_NEW_PLACEHOLDER, MF_BYCOMMAND); RegCloseKey(hMainKey); } + + if (data->profiles.empty()) + { + std::tstring strName = TEXT("Cmd"); + + data->profiles.push_back(strName); + MENUITEMINFO mii = {}; + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_ID | MIIM_STRING | MIIM_STATE; + mii.fType = MFT_STRING; + mii.fState |= MFS_DEFAULT; + mii.wID = ID_NEW_PROFILE_1; + mii.dwTypeData = (LPTSTR) strName.c_str(); + InsertMenuItem(hMenu, ID_NEW_PLACEHOLDER, FALSE, &mii); + DeleteMenu(hMenu, ID_NEW_PLACEHOLDER, MF_BYCOMMAND); + } } HWND hWndMDIClient = CreateWindow(TEXT("MDICLIENT"), (LPCTSTR) NULL, diff --git a/tsm.vcxproj b/tsm.vcxproj index f3dd23e..62fb229 100644 --- a/tsm.vcxproj +++ b/tsm.vcxproj @@ -41,32 +41,32 @@ {F7508F50-F42C-4091-A87E-227FFE89C038} Win32Proj tsm - 10.0.17763.0 + 10.0 StaticLibrary true - v140 + v142 Unicode StaticLibrary false - v140 + v142 true Unicode StaticLibrary true - v140 + v142 Unicode StaticLibrary false - v140 + v142 true Unicode -- cgit v1.2.3