I am trying to change my window background but the function GetWindowRect is not getting the left and top values right. The FillRect function only fills a quarter of the screen and the rest is left transparent. When I set the left and top values manually it works fine, filling the whole window.
case WM_ERASEBKGND:{
hdc = BeginPaint(hwnd, &ps);
RECT rect;
GetWindowRect(hwnd, &rect);
rect.left = 0; //It only works
rect.top = 0; //if I do this
FillRect(hdc, &rect, CreateSolidBrush(RGB(240,240,240));
EndPaint(hwnd, &ps);
}
break;