title: Draw mouse cursor
body: <p>I'm trying to simulate a mouse cursor in Win32 forms. On every <code>WM_MOUSEMOVE</code> I have</p>
  <pre><code>hCursor = LoadCursor(NULL, IDC_ARROW);
  ////Get device context
  hDeviceContext = GetDC(hwnd);
  hDCMem = CreateCompatibleDC(hDeviceContext);
  hBitmap = CreateCompatibleBitmap(hDCMem, 50, 50);
  hbmOld = SelectObject(hDCMem, hBitmap);
  DrawIcon(hDCMem, x, y, hCursor);
  SelectObject(hDCMem, hbmOld);
  </code></pre>
  <p>But I don't see anything being drawn. However if I drew directly on the DC:</p>
  <pre><code>DrawIcon(hDeviceContext, x, y, hCursor);
  </code></pre>
  <p>I do see the cursor but it does not erase the image as I move the cursor, leaving a long tail behind.</p>