From 2d6a972e85e85b3541af8d6fcd413912f0536e3f Mon Sep 17 00:00:00 2001 From: Grayson Riffe Date: Thu, 4 Jun 2026 20:11:49 -0500 Subject: [PATCH] Change background color --- WatchfulEye/resource.rc | 4 ++-- WatchfulEye/src/Application.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/WatchfulEye/resource.rc b/WatchfulEye/resource.rc index 02a1d20..32d1735 100644 --- a/WatchfulEye/resource.rc +++ b/WatchfulEye/resource.rc @@ -54,8 +54,8 @@ EXSTYLE WS_EX_TOPMOST CAPTION "Dialog" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - CTEXT "00:00",IDC_STATICTIME,17,27,266,60,SS_CENTERIMAGE - CTEXT "Time left on tester:",IDC_STATICUPPER,54,4,190,22,SS_CENTERIMAGE + CTEXT "00:00",IDC_STATICTIME,17,27,266,60,SS_CENTERIMAGE,WS_EX_TRANSPARENT + CTEXT "Time left on tester:",IDC_STATICUPPER,54,4,190,22,SS_CENTERIMAGE,WS_EX_TRANSPARENT END diff --git a/WatchfulEye/src/Application.cpp b/WatchfulEye/src/Application.cpp index 255c8d5..cc13758 100644 --- a/WatchfulEye/src/Application.cpp +++ b/WatchfulEye/src/Application.cpp @@ -79,6 +79,31 @@ namespace watchfuleye { return TRUE; } + case WM_ERASEBKGND: { + HDC hDC = reinterpret_cast(wParam); + + HBRUSH backgroundBrush = CreateSolidBrush(RGB(255, 150, 150)); + + RECT clientRect = {}; + GetClientRect(dlg, &clientRect); + FillRect(hDC, &clientRect, backgroundBrush); + + DeleteObject(backgroundBrush); + + return TRUE; + } + + case WM_CTLCOLORSTATIC: { + if (GetWindowLongPtr(reinterpret_cast(lParam), GWL_EXSTYLE) & WS_EX_TRANSPARENT) { + std::cout << "Test\n"; + SetBkMode(reinterpret_cast(wParam), TRANSPARENT); + + return reinterpret_cast(GetStockObject(NULL_BRUSH)); + } + + return FALSE; + } + case WM_CLOSE: { // Do nothing return TRUE;