Change background color
This commit is contained in:
parent
35b0d02af5
commit
2d6a972e85
@ -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
|
||||
|
||||
|
||||
|
||||
@ -79,6 +79,31 @@ namespace watchfuleye {
|
||||
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: {
|
||||
// Do nothing
|
||||
return TRUE;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user