谢谢!

解决方案 »

  1.   

    int nWidth  = GetSystemMetrics(SM_CXSCREEN);
    int nHeight = GetSystemMetrics(SM_CYSCREEN);
    if (nWidth<1024)
    {
    CString cstr;
    cstr.Format("对不起!您显示器的当前分辨率为%d*%d,本系统要求最小1024*768",nWidth,nHeight);
    AfxMessageBox(cstr);
    CBitmapDialog::OnCancel();

    }
    if (nWidth>1024)
    {
    CString cstr;
    cstr.Format("对不起!您显示器的当前分辨率为%d*%d,本系统建议1024*768",nWidth,nHeight);
    AfxMessageBox(cstr);

    }
      

  2.   

    int nWidth  = GetSystemMetrics(SM_CXSCREEN);
    int nHeight = GetSystemMetrics(SM_CYSCREEN);Switch(nWidth * nHeight)
    {
    case 1024 * 768:
           LoadBmp(One);
           break; 
    case 800 * 600:
           LoadBmp(Two);
           break;
    default :
           break; 
    }
      

  3.   

    响应系统窗口大小发改变的消息获取修改后的大小,按不同的大小选取 BMP 图
    ON_MESSAGE(WM_WINDOWPOSCHANGED,OnWindowPosChanged)
    //用户改变了窗口的大小时,更新系统界面
    LRESULT CDialogEx::OnWindowPosChanged(WPARAM wParam,LPARAM lParam)
    {
    WINDOWPOS* pPos;
    pPos = (WINDOWPOS*) lParam ;
    CDialog::OnWindowPosChanged(pPos); //如果是系统的屏幕大小改变则做一次再分
    if( m_bIsDocked == TRUE )
    {
    //获取系统屏幕的大小
    int nSysCX=GetSystemMetrics(SM_CXSCREEN);
    int nSysCY=GetSystemMetrics(SM_CYSCREEN); if( m_nOldCXscr != nSysCX || m_nOldCYscr != nSysCY )
    {
    m_nOldCXscr = nSysCX ;
    m_nOldCYscr = nSysCY ;
    ModifyDesktopWorkArea(FALSE);
    }
    }
    return 0;
    }