CRect rtWnd, rtTitle, rtButtons;
           GetWindowRect(&rtWnd); //整个Window的相对于屏幕的矩形
           //取得整个Title bar的矩形
           rtTitle.left=GetSystemMetrics(SM-CXFRAME);
           rtTitle.top=GetSystemMetrics(SM-CYFRAME);
           rtTitle.right=rtWnd.right-rtWnd.left-GetSystemMetrics(SM-CXFRAME);
           rtTitle.bottom=rtTitle.top+GetSystemMetrics(SM-CYSIZE);
         //计算时的代码,我真的看不懂。

解决方案 »

  1.   

    GetSystemMetrics(SM-CXFRAME)//屏幕的宽度
    GetSystemMetrics(SM-CYSIZE);//屏幕的高度
      

  2.   

    屏幕,?那个屏幕呢?整个windows的宽度呢,还桌面的宽度呢?
      

  3.   

    SM_CXFRAME和SM_CYSIZE分别指窗体的边框(sizing border)的横向长度和纵向长度。这些语句计算的应该是整个窗体除去边框的那部分矩形区域。
      

  4.   

    frame是边上小匡的宽度,大约3左右 ;)
    cysize也是3左右
      

  5.   

    CRect rtWnd, rtTitle, rtButtons;
               GetWindowRect(&rtWnd); //整个Window的相对于屏幕的矩形
               //取得整个Title bar的矩形
               rtTitle.left=GetSystemMetrics(SM-CXFRAME);//获得标题栏的坐标X,也就是left
               rtTitle.top=GetSystemMetrics(SM-CYFRAME);//获得标题栏的坐标Y,也就是top
               rtTitle.right=rtWnd.right-rtWnd.left-GetSystemMetrics(SM-CXFRAME);
               rtTitle.bottom=rtTitle.top+GetSystemMetrics(SM-CYSIZE);