Gaboros
Gaboros

Reputation: 191

c++ win32 background

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?

Upvotes: 0

Views: 395

Answers (1)

IronMensan
IronMensan

Reputation: 6831

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

Upvotes: 2

Related Questions