aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadAd <adamgates84+github@gmail.com>2021-07-06 16:37:01 +1000
committerRadAd <adamgates84+github@gmail.com>2021-07-06 16:37:01 +1000
commitfa32e0c6d33792861fa4a7fac83f5bf987d1ac3d (patch)
treeaed89b9e4696bc43ee739b0468b16e197d7c2ce0
parentd66f640c8122d841ef80bf24b2567392787d18aa (diff)
downloadRadTerminal-fa32e0c6d33792861fa4a7fac83f5bf987d1ac3d.tar.gz
RadTerminal-fa32e0c6d33792861fa4a7fac83f5bf987d1ac3d.zip
Update to latest VS2019
-rw-r--r--RadTerminal.cpp7
-rw-r--r--RadTerminal.vcxproj4
-rw-r--r--RadTerminalFrame.cpp19
-rw-r--r--tsm.vcxproj10
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 @@
<ProjectGuid>{5660720B-5A4B-4F82-85C3-AE789F685218}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>RadTerminal</RootNamespace>
- <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
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 @@
<ProjectGuid>{F7508F50-F42C-4091-A87E-227FFE89C038}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>tsm</RootNamespace>
- <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>