~$ 存档

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

示例代码:

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);

 

posted on 2017-08-13 19:33  LuoTian  阅读(417)  评论(0编辑  收藏  举报