aboutsummaryrefslogtreecommitdiff
path: root/RadTerminalFrame.cpp
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 /RadTerminalFrame.cpp
parentd66f640c8122d841ef80bf24b2567392787d18aa (diff)
downloadRadTerminal-fa32e0c6d33792861fa4a7fac83f5bf987d1ac3d.tar.gz
RadTerminal-fa32e0c6d33792861fa4a7fac83f5bf987d1ac3d.zip
Update to latest VS2019
Diffstat (limited to 'RadTerminalFrame.cpp')
-rw-r--r--RadTerminalFrame.cpp19
1 files changed, 17 insertions, 2 deletions
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,