aboutsummaryrefslogtreecommitdiff
path: root/RadTerminalFrame.cpp
diff options
context:
space:
mode:
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,