Handle leaking is probably located in WM_PAINT, or OnPaint, OnDraw functions...can you paste that code too?