//本函数使用方法: 
     //第一个参数:如果是TRUE表示显示扩展的对话框,如果是FALSE,表示缩小对话框。 
     //第二个参数:表示本对话框的HWND, 
     //第三个参数:表示缩小后大小的控件的ID
    void COptionDlg::ExpandBox(BOOL fExpand, HWND hwnd, int nIDDefaultBox)
    {
         CWnd *pWndBox=GetDlgItem(nIDDefaultBox);
         RECT rcDefaultBox,rcChild,rcIntersection,rcWnd;
         pWndBox->GetWindowRect(&rcDefaultBox);
         HWND hwndChild = ::GetTopWindow(hwnd);
         for (; hwndChild != NULL; hwndChild = ::GetNextWindow(hwndChild,GW_HWNDNEXT)) 
         {
                  ::GetWindowRect(hwndChild, &rcChild);
                  if (!IntersectRect(&rcIntersection, &rcChild, &rcDefaultBox))
                           ::EnableWindow(hwndChild, fExpand);
         }
         ::GetWindowRect(hwnd, &rcWnd);
         if (GetWindowLong(hwnd, GWL_USERDATA) == 0)
         {
                  SetWindowLong(hwnd, GWL_USERDATA,
                           MAKELONG(rcWnd.right - rcWnd.left, 
                           rcWnd.bottom - rcWnd.top));
                  ::ShowWindow(pWndBox->m_hWnd, SW_HIDE);
         }
         ::SetWindowPos(hwnd, NULL, 0, 0,
                  rcDefaultBox.right - rcWnd.left,
                  rcDefaultBox.bottom - rcWnd.top,
                  SWP_NOZORDER | SWP_NOMOVE);
         if(fExpand)
         {
                  DWORD dwDims = GetWindowLong(hwnd, GWL_USERDATA);
                  ::SetWindowPos(hwnd, NULL, 0, 0,
                           LOWORD(dwDims), HIWORD(dwDims), SWP_NOZORDER | SWP_NOMOVE);
                  ::SendMessage(hwnd, DM_REPOSITION, 0, 0);
         }
    }