[newbie] repainting window
hey hey... just started windows programming today... looked through some tutorials but alittle lost... wondering if someone can help me with a simple question
i have a background color in my window but when i resize it the background color is lost... not quite sure how i would keep the background color..
Do I need to use a PaintStruct? (i don't even know what it is :) )
LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
static int counter = 0;
hdc = GetDC(hwnd);
counter = counter + 1;
if (counter == 1)
hbrush = CreateSolidBrush(RGB(255, 64, 43));
else if (counter == 2)
hbrush = CreateSolidBrush(RGB(89, 65, 0));
else if (counter == 3)
hbrush = CreateSolidBrush(RGB(55, 0, 56));
return DefWindowProc (hwnd, iMsg, wParam, lParam);
I know i need "case WM_PAINT:" in there but i'm not sure what to put after that. Do i need "case WM_SIZE:" ?
also did i free memory properly or am i missin' something?
thnx in advance for any kind of help