1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

controls disappears when minimized

Discussion in 'Win32' started by tamirvs, Sep 8, 2010.

  1. tamirvs

    tamirvs New Member

    Joined:
    Sep 8, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello,
    I have a window with controls, that i create during the wm_paint message.
    I've put the creation of the controls in an If Statement so that they are created only once.
    Now, when i minimize the window, and then maximize it again, all the controls, except the Static ones, disappear. If i hover them with my mouse they appear again.

    if i remove the If Statement, so that they are created in every WM_PAINT message, they don't disappear ofcourse, but why would i create the controls over and over..?

    in my WM_PAINT message i return DefWindowProc().

    any idea why this is happening?
     
  2. go4expert

    go4expert Moderator

    Joined:
    Aug 3, 2004
    Messages:
    306
    Likes Received:
    7
    Trophy Points:
    0
    You should not create them in paint but you should create them before and keep reference to them to be used in paint.
     

Share This Page