title: c++ gdi animation not working
body: <p>im trying to create ball animation using gdi but i can't get it working.
  i created a ball using this</p>
  
  <pre><code>   Graphics graphics(hdc);
  </code></pre>
  
  <p>Pen      pen(Color(255, 0, 0, 255));
     graphics.DrawEllipse(&amp;pen, sf , 0, 10, 10);
  i have while loop that loops and adds 1 to sf value basicly like this sf++;
  than i try to repaint the window(it doesn't work) so ill end up with more than one circle ;/ 
  here is the loop( the loop is int WM_PAINT)</p>
  
  <pre><code>while(sd==1)//sd equals 1
      {
          sf++;
          onPaint(hdc);
          InvalidateRect (hWnd, NULL, TRUE);// this should repaint the window but it doesn't
          UpdateWindow(hWnd);
      }
  </code></pre>
  
  <p>thanks in advance 
  Rami</p>