CRect rectL,rectR;
GetDlgItem(IDC_PIC1)->GetWindowRect(&rectL);//获取控件相对于屏幕的位置
ScreenToClient(rectL);//转化为对话框上的相对位置
GetDlgItem(IDC_PIC2)->GetWindowRect(&rectR);//获取控件相对于屏幕的位置
ScreenToClient(rectR);//转化为对话框上的相对位置
int heigth;
int width;
height=rectL.bottom-rectL.top;//height为button的高
width=rectL.right-rectL.left;//width为button的宽