title: How to not discard a CDC path?
body: <p>I draw some symbols, that belong to certain objects, into a device context and now want to be able to later test if the mouse cursor is above such a symbol.</p>
  
  <p>To do this, my plan was to first create a <code>CDC</code> path and use that to create a <code>CRgn</code> region object.</p>
  
  <pre><code>pDC-&gt;BeginPath();
  pDC-&gt;Ellipse(ellipse[0], ellipse[1], ellipse[2], ellipse[3]); // Create path only
  pDC-&gt;EndPath();
  
  // Actually draw the ellipse
  pDC-&gt;StrokeAndFillPath(); // Apparently removes the path from the DC
  
  CRgn region;
  if (region.CreateFromPath(pDC)) // Would also remove the path from the DC
  {
      // We never get here :-/
  
      // Here I would copy the region's data,
      // attach it to the object being drawn and
      // destroy the region.
      // That way I can create a region later on and do the hit-testing.
  }
  </code></pre>
  
  <p>How can I use the path for both, drawing and creating the region, without having to draw twice? Drawing twice pretty much doubles the time spent in my drawing method, which is something I'd like to avoid.</p>