From 19eb082fd6a7b20b2118b2739174d7c217a34343 Mon Sep 17 00:00:00 2001 From: Quantum Date: Wed, 25 Sep 2013 12:44:58 -0400 Subject: [PATCH] Fixed background colour problems. --- include/MainWindow.hpp | 1 - src/MainWindow.cpp | 12 ++---------- src/Window.cpp | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/include/MainWindow.hpp b/include/MainWindow.hpp index c555e23..c6817d5 100644 --- a/include/MainWindow.hpp +++ b/include/MainWindow.hpp @@ -68,7 +68,6 @@ protected: PreviewWindow *m_preview, *m_data_display; private: HFONT hFont; - HBRUSH hBrush; UDACCEL *udaSecondAccel; }; diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 2f917b0..3b73ae0 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -27,7 +27,6 @@ UINT ZALGO_MESS_LEVEL_[3] = {6, 10, 14}; #pragma comment(lib, "comdlg32.lib") WNDPROC wpOrigEditProc; -DWORD rgbWindowBackground; wchar_t *GetResourceString(int id, HMODULE module = NULL) { HRSRC hRC; @@ -73,8 +72,6 @@ LRESULT MainWindow::OnCreate() GetClientRect(m_hwnd, &client); GetMessageFont(lf); hFont = CreateFontIndirect(&lf); - hBrush = GetSysColorBrush(COLOR_WINDOW); - rgbWindowBackground = GetSysColor(COLOR_WINDOW); initial = GetResourceString(RID_INIT); if (!initial) @@ -400,15 +397,10 @@ LRESULT MainWindow::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) } break; case WM_CTLCOLORSTATIC: { - HBRUSH white = CreateSolidBrush(RGB(255, 255, 255)); + HBRUSH white = GetStockBrush(WHITE_BRUSH); if ((HWND) lParam == m_messLevel && IsWindowEnabled(m_messLevel)) return (LRESULT) white; - if ((HWND) lParam == m_settings) { - SetBkColor((HDC) wParam, GetSysColor(COLOR_3DFACE)); - return (LRESULT) GetSysColorBrush(COLOR_3DFACE); - } - SetBkColor((HDC) wParam, rgbWindowBackground); - return (LRESULT) hBrush; + break; } case WM_KEYDOWN: if (wParam == 'K' && GetKeyState(VK_CONTROL) < 0 && diff --git a/src/Window.cpp b/src/Window.cpp index 343817c..81a9663 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -25,7 +25,7 @@ void Window::Register() wc.hInstance = GetInstance(); wc.hIcon = GetIcon(); wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = CreateSolidBrush(RGB(0xF0, 0xF0, 0xF0)); + wc.hbrBackground = (HBRUSH) (COLOR_3DFACE + 1); wc.lpszMenuName = NULL; wc.lpszClassName = ClassName();