繁体   English   中英

在MFC C ++中获取窗口或面板的大小

[英]getting the size of a window or panel in MFC C++

如何获得MFC C ++中“窗口”或“面板”的大小 有功能或东西吗?

CRect MyRect;

CWnd :: GetDesktopWindow()-> GetWindowRect(MyRect)

CWnd::GetWindowRect

CWnd  wnd; // the window to query
CRect wndrect;

wnd.GetWindowRect(wndrect);

从那里你可以得到

int w = wndrect.Width ();
int h = wndrect.Height();

这将适用于所有类型的MFC窗口,因为所有MFC窗口类都继承CWnd

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM