hmm, is it possible to call an if statement within WM_PAINT such as:
Code:
case WM_PAINT:
{
// Just a note, never use a MessageBox from inside WM_PAINT
// The box will cause more WM_PAINT messages and you'll probably end up
// stuck in a loop
BITMAP bm;
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
HDC hdcMem = CreateCompatibleDC(hdc);
HBITMAP hbmOld = SelectObject(hdcMem, Logobmp);
GetObject(Logobmp, sizeof(bm), &bm);
BitBlt(hdc, 100, 50, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);
if (ClrScreen >= 0){
BitBlt(hdc, 0, 0, 800, 600,hdc, 0, 0, WHITENESS);
}
SelectObject(hdcMem, hbmOld);
DeleteDC(hdcMem);
EndPaint(hwnd, &ps);
}
break;
And than set the int ClrScreen to something greater than 0 and call WM_PAIT again:
Code:
case ID_FILE_NEW:
ClrScreen = 1;
PostMessage(hwnd, WM_PAINT, 0, 0);
However this doesn't work either for some reason.
EDIT: got it working with InvalidateRect(hwnd, NULL, FALSE ); instead of postmessege