diff options
author | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2021-10-05 09:09:48 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2021-10-05 09:09:48 -0400 |
commit | b3676102a2ca1578220ef585d933732825ac196e (patch) | |
tree | 2c224a5aeb7d86669cb1732df1f7967aecbb4816 | |
parent | 7fe31126d121e810dd93641ae6582e9ab1dac16e (diff) | |
download | RadTerminal-b3676102a2ca1578220ef585d933732825ac196e.tar.gz RadTerminal-b3676102a2ca1578220ef585d933732825ac196e.zip |
Fixed handling of blank commands
-rw-r--r-- | RadTerminal.cpp | 20 | ||||
-rw-r--r-- | RadTerminalDll.vcxproj | 2 |
2 files changed, 15 insertions, 7 deletions
diff --git a/RadTerminal.cpp b/RadTerminal.cpp index 5dae48e..57842c5 100644 --- a/RadTerminal.cpp +++ b/RadTerminal.cpp @@ -219,7 +219,7 @@ extern "C" { if (fontFace != NULL) rtc.strFontFace = std::tstring(fontFace); - if (command != NULL) + if (command != NULL && wcslen(command) > 0) rtc.strCommand = std::tstring(command); if (working_directory != NULL) @@ -240,7 +240,7 @@ extern "C" { if (darkMode) { SetWindowTheme(hRet, L"DarkMode_Explorer", NULL); // Needed for scrollbar - AllowDarkModeForWindow(hRet, true); + //AllowDarkModeForWindow(hRet, true); } return hRet; @@ -998,9 +998,17 @@ void RadTerminalWindowOnPaint(HWND hWnd) HBITMAP hbitmap = CreateCompatibleBitmap(hdc, ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top); HBITMAP hbitmapold = SelectBitmap(hmemdc, hbitmap); - HBRUSH hBrush = (HBRUSH) GetClassLongPtr(hWnd, GCLP_HBRBACKGROUND); - if (hBrush != NULL) - FillRect(hmemdc, &ps.rcPaint, hBrush); + //HBRUSH hBrush = (HBRUSH) GetClassLongPtr(hWnd, GCLP_HBRBACKGROUND); + //if (hBrush != NULL) + // FillRect(hmemdc, &ps.rcPaint, hBrush); + COLORREF bkgd = RGB(color_default_pallette[TSM_COLOR_BACKGROUND][0], + color_default_pallette[TSM_COLOR_BACKGROUND][1], + color_default_pallette[TSM_COLOR_BACKGROUND][2]); + HBRUSH hbkgd = CreateSolidBrush(bkgd); + if (hbkgd != NULL) { + FillRect(hmemdc, &ps.rcPaint, hbkgd); + DeleteObject(hbkgd); + } tsm_screen_draw_data draw = {}; draw.hdc = hmemdc; @@ -1529,7 +1537,7 @@ LRESULT CALLBACK RadTerminalWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR HANDLE_MSG(hWnd, WM_RBUTTONDOWN, RadTerminalWindowOnRButtonDown); HANDLE_MSG(hWnd, WM_TIMER, RadTerminalWindowOnTimer); HANDLE_MSG(hWnd, WM_SIZE, RadTerminalWindowOnSize); - HANDLE_MSG(hWnd, WM_SIZING, RadTerminalWindowOnSizing); + //HANDLE_MSG(hWnd, WM_SIZING, RadTerminalWindowOnSizing); HANDLE_MSG(hWnd, WM_VSCROLL, RadTerminalWindowOnVScroll); HANDLE_MSG(hWnd, WM_DROPFILES, RadTerminalWindowOnDropFiles); HANDLE_MSG(hWnd, WM_COMMAND, RadTerminalWindowOnCommand); diff --git a/RadTerminalDll.vcxproj b/RadTerminalDll.vcxproj index cfb481d..cb8b6c4 100644 --- a/RadTerminalDll.vcxproj +++ b/RadTerminalDll.vcxproj @@ -87,7 +87,7 @@ <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions);BUILD_AS_DLL</PreprocessorDefinitions> </ClCompile> <Link> <EnableCOMDATFolding>true</EnableCOMDATFolding> |