如何获取窗体的宽度,高度

lrlike 2003-02-24 11:16:45
我想在点击按扭后改变窗体的大小,在OnWindowPosChanging 中可获取windowpos 的cx,cy.但必须是运行SetWindowPos之后,用GetWindowRgn好象也有问题。请各位大虾指教。
...全文
281 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
alornwolf 2003-02-25
  • 打赏
  • 举报
回复
初始化可以在OnCreate()里
SetWindowsPos();设置窗体位置
MoveWindow();称动窗体
lrlike 2003-02-25
  • 打赏
  • 举报
回复
谢了,不过我的本意是想初始化时将窗体的高度和宽度调整,WindowPos结构包含了窗体的位置和大小。
rockroll 2003-02-24
  • 打赏
  • 举报
回复
getwindowrect
setwindowext
kingtsui 2003-02-24
  • 打赏
  • 举报
回复
什么意思啊? 看不大明白
获取窗体的宽度、高度可以用
GetWindowRect
GetWindowPlacement
GetWindowInfo
GetWindowRgn
GetWindowRgnBox
HowUCan 2003-02-24
  • 打赏
  • 举报
回复
GetWindowRect
coolover 2003-02-24
  • 打赏
  • 举报
回复
CRect rc;
GetWindowRect( &rc );
int width = rc.Width();
int height= rc.Height();

15,980

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧