Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Windows - REPAINT

pjn9656pjn9656 Member Posts: 11
Just a new guy starting out programming, reading a couple of books and have a question.
1. I create a window with a button ( WM_CREATE) . when the window is invalidated by covering it up and then brought to the forground again the contents are redrawn if i move it. In side of the case statement i have a empty WMPaint statment. I guess my question is this. Does the WM_CREATE get called also therfore creating the buttons again?

case WM_PAINT:
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
2. How do i make sure the button is there each time without moving the parent window once it is invalidated then on top again.

Excuse the simplicity..
Thanks,
pjn9656

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    [color=Blue]
    WM_PAINT case cannot be empty.
    It must look like that:
    [/color]
    [code]
    case WM_PAINT:
    return DefWindowProc (...);
    [/code]
    [color=Blue]or like this:[/color]
    [code]
    case WM_PAINT:
    BeginPaint (...);
    //
    // Your painting code here, but you can omit it.
    //
    EndPaint (...);
    return 0;
    [/code]
Sign In or Register to comment.