Change background color

This commit is contained in:
Grayson Riffe 2026-06-04 20:11:49 -05:00
parent 35b0d02af5
commit 2d6a972e85
Signed by: grayson
SSH Key Fingerprint: SHA256:23HJg9tnL2m6u0uUb26QIrOTFymFZ+xgSH/2UPEBB/I
2 changed files with 27 additions and 2 deletions

View File

@ -54,8 +54,8 @@ EXSTYLE WS_EX_TOPMOST
CAPTION "Dialog" CAPTION "Dialog"
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
CTEXT "00:00",IDC_STATICTIME,17,27,266,60,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 CTEXT "Time left on tester:",IDC_STATICUPPER,54,4,190,22,SS_CENTERIMAGE,WS_EX_TRANSPARENT
END END

View File

@ -79,6 +79,31 @@ namespace watchfuleye {
return TRUE; return TRUE;
} }
case WM_ERASEBKGND: {
HDC hDC = reinterpret_cast<HDC>(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<HWND>(lParam), GWL_EXSTYLE) & WS_EX_TRANSPARENT) {
std::cout << "Test\n";
SetBkMode(reinterpret_cast<HDC>(wParam), TRANSPARENT);
return reinterpret_cast<INT_PTR>(GetStockObject(NULL_BRUSH));
}
return FALSE;
}
case WM_CLOSE: { case WM_CLOSE: {
// Do nothing // Do nothing
return TRUE; return TRUE;