title: STM_SETIMAGE doesn't invalidate/repaint the static control
body: <p>Can anyone tell me if it's normal or not for a static control not to invalidate its area after the bitmap has been changed with the STM_SETIMAGE message?</p>
  
  <p>I use a static control with the SS_BITMAP style, and I set its picture with the following code</p>
  
  <pre><code>    HBITMAP DestBmp;
      // Paint on DestBmp...
  
      HBITMAP hOldBmp = (HBITMAP) ::SendMessage(hStatic, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) DestBmp);
      if (hOldBmp)
          DeleteObject(hOldBmp);
  
      // *** Why do I need this? ***
      ::InvalidateRect(hStatic, NULL, FALSE);
  </code></pre>
  
  <p>If I don't call InvalidateRect, the static control doesn't repaint itself. Is this the normal behaviour of STM_SETIMAGE, or am I doing something wrong? The documentation <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb760782%28v=vs.85%29.aspx" rel="nofollow">at MSDN</a> doesn't mention anything about needing to call InvalidateRect after STM_SETIMAGE, and its strange anyway, you don't need to call InvalidateRect after SetWindowText for example. This makes me think something might be wrong with my code.</p>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>This is how the control is defined in my .rc file</p>
  
  <pre><code>CONTROL         "",IDC_IMAGE_PREVIEW,"Static",SS_BITMAP | NOT WS_VISIBLE,29,293,15,13
  </code></pre>
  
  <p>The <code>NOT WS_VISIBLE</code> flag is not a problem, I make the control visible with <code>ShowWindow(SW_SHOW);</code> later.</p>