GetWindowRect

示例代码:

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);
原文地址:https://www.cnblogs.com/tinaluo/p/7354451.html