虽不太难 还是写来以后会方便不少
IDC_S是一个 图像 控件 用于指明分割窗口的位置
void
CZzDlg::OnOK()

...
{
CString str;
GetDlgItemText(IDOK,str);
if(str=="收")

...{
SetDlgItemText(IDOK,"放");
}else

...{
SetDlgItemText(IDOK,"收");

}
static CRect rectLarge;
static CRect rectSmall;
if(rectLarge.IsRectNull())

...{
GetWindowRect(&rectLarge);

CRect rectSeparator;

GetDlgItem(IDC_S)->GetWindowRect(&rectSeparator);

rectSmall.left=rectLarge.left;
rectSmall.top=rectLarge.top;
rectSmall.right=rectLarge.right;
rectSmall.bottom=rectSeparator.bottom;

}
if(str=="收")

...{
SetWindowPos(NULL,0,0,rectSmall.Width(),rectSmall.Height(),SWP_NOMOVE|SWP_NOZORDER);
}
else

...{
SetWindowPos(NULL,0,0,rectLarge.Width(),rectLarge.Height(),SWP_NOMOVE|SWP_NOZORDER);
}
}
参考文献:VC++编程详解 作者:孙鑫