It is working by me :) :
void CMyButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
pDC->RoundRect(0,
0,
lpDrawItemStruct->rcItem.right,
lpDrawItemStruct->rcItem.bottom,
50,
50);
CRgn cRgn1;
cRgn1.CreateRoundRectRgn(1,
1,
lpDrawItemStruct->rcItem.right,
lpDrawItemStruct->rcItem.bottom,
50,
50);
pDC->SelectClipRgn(&cRgn1);
pDC->FillSolidRect(&lpDrawItemStruct->rcItem, 0x00FFFFFF);
CRgn cRgn2;
cRgn2.CreateRoundRectRgn(2,
2,
lpDrawItemStruct->rcItem.right -1,
lpDrawItemStruct->rcItem.bottom -1,
50,
50);
pDC->SelectClipRgn(&cRgn2);
...
P.S. For the "fine working"
you could implement the drawing with GDI+ functions :)