如何得到窗口的高度,宽度,以及窗口左上角的坐标?
CWnd中有没有相应属性,是不是所有可视化控件都有这些属性?

解决方案 »

  1.   

    CRect rect;
    CWnd::GetWindowRect(rect);
      

  2.   

    GetWindowRect是返回相对屏幕坐标的窗口位置.
    GETCLIENTRECT是相对于父窗口的客户区域.
      

  3.   

    CRect rcWin;
    GetWindowRect(&rcWin);
    rc.Width();//宽
    rc.Hight();//高
    rc.TopLeft();//左上角的坐标
      

  4.   

    楼上都说了,
    建议看看MSDN:CWnd::GetWindowRect()
    CWnd::GetClientRect()
    CWnd::ScreentoClient()
    CWnd::ClienttoScreen()
    CWnd::MoveWindow()
      

  5.   

    m_status.GetClientRect(r_status);
    这样用系统总是要报错