在 MFC C++中获取窗口或面板的大小
getting the size of a window or panel in MFC C++
如何在MFC C++中获取"窗口"或"面板"的大小?有功能什么的吗?
有CWnd::GetWindowRect
:
CWnd wnd; // the window to query
CRect wndrect;
wnd.GetWindowRect(wndrect);
从那里你可以得到
int w = wndrect.Width ();
int h = wndrect.Height();
这将适用于所有类型的 MFC 窗口,因为所有 MFC 窗口类都继承CWnd
。
相关文章:
- MFC 中的窗口消息管理:添加基类调用是否是强制性的?
- 如何在 Win32 窗口中实现 MFC 资源
- 如何将子窗口(MFC 应用程序)的工作区保存到图像
- 最小化/最大化后,MFC窗口图形消失了
- 延迟窗口在 MFC 上显示文本
- 如何调用OnEraseBkgnd()在另一个函数中重新绘制窗口?(MFC)
- 先前在MFC中删除窗口
- 如何在WebBrowser控件窗口中生成异常.MFC中实现的外部方法
- 如何在窗口 MFC 应用程序中更改图像
- MFC单击并移动/拖动对话框窗口
- 在最小化的 MFC 窗口中查找 CListCtrl 的有效大小
- 利用mfc子窗口进行二维碰撞检测
- MFC - 主窗口/进程的随机名称和类名
- 在 MFC 窗口中使用 PNG 作为背景图像
- 如何使用 MFC 获取单独窗口的句柄
- 如何修改此基于MFC的代码片段以使用自己选择的窗口类名
- C++MFC按钮在窗口调整大小时消失
- 我自己的C++框架(类似MFC),我可以创建子窗口,但不能在WM_create时创建编辑框
- 是否可以创建一个由透明浏览器组件组成的无窗口 mfc c++ 应用程序
- 如何处理外部应用程序窗口?MFC