非常简单的问题:如何用CRect获得当前窗口大小?

解决方案 »

  1.   

    CRect rect;
    GetWindowRect(&rect);
      

  2.   

    此外,如果想获得客户区大小的话,用
    BOOL GetClientRect(
      HWND hWnd,      // handle to window
      LPRECT lpRect   // address of structure for client coordinates
    );
      

  3.   

    CRect rect;
    GetWindowRect(&rect);//获得窗口;
    GetClientRect(&rect);//获得客户区;
      

  4.   

    CRect rect;
    GetWindowRect(&rect);//得到所处窗口的绝对坐标;
    GetClientRect(&rect);//得到相对坐标