Here would be the init stage of a button :) :
CRect cRect;
m_cButton.GetWindowRect(cRect);
m_cRgn.CreateRoundRectRgn(0, 0, cRect.Width(), cRect.Height(), 50, 50);
m_cButton.SetWindowRgn(m_cRgn, TRUE);
Now it is controlled by Windows in this edge.
Secondly, the
m_cButton
must draw
a gradient surface and a title in the same region :)