BOOL CMyPropertySheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
// TODO: Add your specialized code here
CRect rect, tabrect;
int width;
//Get button sizes and positions
GetDlgItem(IDOK)->GetWindowRect(rect);
GetTabControl()->GetWindowRect(tabrect);
ScreenToClient(rect); ScreenToClient(tabrect);
//New button - width, height and Y-coordiate of IDOK
// - X-coordinate of tab control
width = rect.Width();
rect.left = tabrect.left; rect.right = tabrect.left + width;
//Create new "Add" button and set standard font
m_ButtonCopy.Create("Copy",
BS_PUSHBUTTON|WS_CHILD|WS_VISIBLE|WS_TABSTOP,
rect, this, IDC_BUTTON_COPY);
m_ButtonCopy.SetFont(GetFont());
return bResult;
}
void CMyPropertySheet::OnButtonCopy()
{
MessageBox("COPY button pressed!!");
}