title: WinAPI - avoid redraw of window
body: <p>I'm drawing into a WinAPI-Window by using the <code>SetPixel()</code>-Function.</p>
  
  <p>If I scale the window or lose focus (another window is on top) I lose the whole content that I draw into the window.</p>
  
  <p>I just used</p>
  
  <pre><code>RECT rc;
  GetClientRect(hwnd, &amp;rc);
  RedrawWindow(hwnd, &amp;rc, NULL, RDW_NOERASE | RDW_NOFRAME | RDW_VALIDATE);
  </code></pre>
  
  <p>which helped to avoid redrawing the content when I move the window but scaling and losing focus still removes the content.
  Does anyone have an idea what I missed?</p>