title: C++ redraw with DrawText
body: <p>Currently i'm drawing the text from a textbox in my window. I successfully get the text i need to draw and it draws the text. It's ok.</p>
  
  <p>Here's the problem: when i write something else in my input box and draw the text again (via button push), the new text is drawn right on top of the previous text as to be expected.</p>
  
  <p>I'm new to all of this and i can't find a way to clear the previous text before drawing the new text.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>void DrawMyText(HWND hwnd) {
  
      int iTextLength = GetWindowTextLength(hDrawInput) + 1;
      char cDrawText[1000] = "";
      HDC wdc = GetWindowDC(hwnd);    
      RECT canvas;
      canvas.left   = 168;
      canvas.top    = 108;
      canvas.right  = 500;
      canvas.bottom = 500;
  
      GetWindowText(hDrawInput, cDrawText, iTextLength);
  
      SetTextColor(wdc, 0x00FF0066);
      SetBkMode(wdc,TRANSPARENT);
      DrawText(wdc, cDrawText, -1, &amp;canvas, DT_LEFT);
  
      DeleteDC(wdc);
  }
  </code></pre>
  
  <p>Any tips on how to do this? I will gladly provide any additional information if needed. Thanks in advance!</p>