Skip to content

Commit

Permalink
Paint background color gray instead of white
Browse files Browse the repository at this point in the history
  • Loading branch information
eschan145 committed Dec 28, 2024
1 parent 6b420ff commit 0d52b8a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/asteroids.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,23 @@ LRESULT CALLBACK Asteroids::TrayWindowProc(
);

switch (uMsg) {
case WM_ERASEBKGND: {
HDC hdc = (HDC)wParam;
RECT rect;
GetClientRect(hwnd, &rect);
HBRUSH hBrush = CreateSolidBrush(RGB(169, 169, 169));
FillRect(hdc, &rect, hBrush);
DeleteObject(hBrush);
return 1;
}

case WM_PAINT: {
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
EndPaint(hwnd, &ps);
break;
}

case WM_WINDOWPOSCHANGING: {
WINDOWPOS* position = reinterpret_cast<WINDOWPOS*>(lParam);
position->x = asteroids->position.x;
Expand Down

0 comments on commit 0d52b8a

Please sign in to comment.