Hi,
I am having an MDI Application.
My problem is that I want to retrieve the dimensions of NonClientArea of the frame Window.
Can u suggetst , which API can be used for this purpose.
With Best Regs
Printable View
Hi,
I am having an MDI Application.
My problem is that I want to retrieve the dimensions of NonClientArea of the frame Window.
Can u suggetst , which API can be used for this purpose.
With Best Regs
Interesting. :)
Here is the code:
Note that m_hWndMDIClient is a public member of CMDIFrameWnd and represents the handle of MDI Client window.Code:CWnd* pWndMDIClient = CWnd::FromHandle(m_hWndMDIClient);
CRect rcFrame, rcMDIClient;
GetWindowRect(rcFrame);
pWndMDIClient->GetWindowRect(rcMDIClient);
const int nTopHeight = rcMDIClient.top - rcFrame.top;
const int nBottomHeight = rcFrame.bottom - rcMDIClient.bottom;
const int nLeftWidth = rcMDIClient.left - rcFrame.left;
const int nRightWidth = rcFrame.right - rcMDIClient.bottom;
try this link
http://www.codeproject.com/combobox/listboxex.asp
I have tried it.Quote:
Originally Posted by Gunaamirthavelu
BTW. What's the connection between OP and "Control Subclassing"?
I don't think that MDI Client Window has non-client area... But the same code will do just fine for the Frame.Quote:
Originally Posted by ovidiucucu
I dind't say that.Quote:
Originally Posted by VladimirF
The OP was referring to "nonclient area of the frame window in an MDI application".
At a first look I was tempted to answer: "1. call GetWindowRect to get the frame window rectangle; 2. call GetClientRect to get the frame client rectangle; 3. call CientToScreen to transform client rectangle in screen coordinates. 4. make the difference between the two rectangle coordinates...".
But after that, I realised (hope was not wrong, since the question was quite vague) that OP wants in fact the dimensions of main frame window that include docked control bars and status bar.
In that case, you can make the difference between frame window rectangle and contained MDI client window rectangle, as shown in my example.
Sorry, I misread your code...Quote:
Originally Posted by ovidiucucu