示例代码:
CRect rect;GetDlgItem(IDC_STATIC_VIEW)->GetWindowRect(&rect);int width=rect.Width(); //获取窗口宽度int height=rect.Height(); //获取窗口高度int top=rect.top;int left=rect.left;
//完整代码 CRect rect;GetWindowRect(&rect);char info[50];sprintf(info,"窗口的宽度:%d,高度:%d",rect.Width(),rect.Height());MessageBox(info);