Reputation: 163
How can I get the size of a "window" or a "panel" in MFC C++? is there a function or something?
Upvotes: 0
Views: 1376
Reputation: 44063
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
.
Upvotes: 1