title: Redraw window using DirectX during move/resize
body: <p>I've followed this tutorial and got it all working: <a href="http://www.braynzarsoft.net/index.php?p=InitDX11" rel="nofollow">http://www.braynzarsoft.net/index.php?p=InitDX11</a></p>
  
  <p>The result is a window with a constantly changing background color. The trouble is that the color stops changing while the window is being dragged around. I've tried adding the following case statements (in various combinations) to the <code>WndProc</code> callback, but to no avail:</p>
  
  <pre><code>case WM_ENTERSIZEMOVE:
    SetTimer(hwnd, 1, USER_TIMER_MINIMUM, NULL);
    return 0;
  
  case WM_EXITSIZEMOVE:
    KillTimer(hwnd, 1);
    return 0;
  
  case WM_TIMER:
    RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_INTERNALPAINT);
    return 0;
  
  case WM_PAINT:
    UpdateScene();
    DrawScene();
    return 0;
  </code></pre>
  
  <p>The above causes an exception at <code>d3d11DevCon-&gt;ClearRenderTargetView(renderTargetView, bgColor)</code>, but I've also tried merging the <code>WM_PAINT</code> case into the <code>WM_TIMER</code> case, and all I got was flickering between the natural window background color and the current color of the DX scene (the color of the DX portion of the flicker never evolved, it stayed constant no matter for how long I dragged the window).</p>
  
  <p>Any tips?</p>