fondo c ++ win32

How can I force WM_PAINT without clearing the screen?

I want to load a background and I also want to load different images depending on where is the mouse. My problem is, the background is loaded well but when the mouse reach a position and want to load the new image onto the background It doesn't happen because I can't force to send WM_PAINT.

The Mousehover is.

case WM_MOUSEHOVER:
{
    int iPosX = LOWORD(lParam);
    int iPosY = HIWORD(lParam);
    if (((iPosX > 649 && iPosX < 789) && (iPosY > 532 && iPosY < 613)) && Loaded == false) 
    {
        LoadPlayImage = true;
    }
    else 
    {
        LoadPlayImage = false;
    }
}

So this boolean can decide the image must be loaded or not. But I need something to refresh the screen without dropping the background so depending on the position the image should appear (or not) onto the background. But the background must be saved even if the images is loaded or not. Any ideas?

preguntado el 27 de agosto de 11 a las 21:08

Pretty hard to follow. Hard to imagine the answer isn't in using InvalidateRect(). -

1 Respuestas

You can trigger a repaint of your window with InvalidateRect http://msdn.microsoft.com/en-us/library/dd145002(VS.85).aspx

Respondido 28 ago 11, 02:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.