Skip to content

Commit

Permalink
Update to latest VS2019
Browse files Browse the repository at this point in the history
  • Loading branch information
RadAd committed Jul 6, 2021
1 parent d66f640 commit fa32e0c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
7 changes: 5 additions & 2 deletions RadTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions RadTerminal.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
19 changes: 17 additions & 2 deletions RadTerminalFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions tsm.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit fa32e0c

Please sign in to comment.