在MFC C ++中获取窗口或面板的大小(getting the size of a window or panel in MFC C++)
如何在MFC C ++中获得“窗口”或“面板”的大小 ? 有功能还是什么?
How can I get the size of a "window" or a "panel" in MFC C++? is there a function or something?
最满意答案
有CWnd::GetWindowRect :
CWnd wnd; // the window to query CRect wndrect; wnd.GetWindowRect(wndrect);从那里你可以得到
int w = wndrect.Width (); int h = wndrect.Height();这适用于所有类型的MFC窗口,因为所有MFC窗口类都继承CWnd 。
There is CWnd::GetWindowRect:
CWnd wnd; // the window to query CRect wndrect; wnd.GetWindowRect(wndrect);And from there you can get
int w = wndrect.Width (); int h = wndrect.Height();This will work for all kinds of MFC windows because all MFC window classes inherit CWnd.
更多推荐
发布评论