|
-
March 7th, 2006, 12:31 AM
#1
Retrieving Dimension of a NonClientArea in a MDI Application
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
-
March 7th, 2006, 08:51 AM
#2
Re: Retrieving Dimension of a NonClientArea in a MDI Application
Interesting. 
Here is the code:
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;
Note that m_hWndMDIClient is a public member of CMDIFrameWnd and represents the handle of MDI Client window.
-
March 7th, 2006, 09:05 AM
#3
Re: Retrieving Dimension of a NonClientArea in a MDI Application
If I Helped You, "Rate This Post"
Thanks
Guna
-
March 7th, 2006, 09:40 AM
#4
Re: Retrieving Dimension of a NonClientArea in a MDI Application
 Originally Posted by Gunaamirthavelu
I have tried it.
BTW. What's the connection between OP and "Control Subclassing"?
-
March 7th, 2006, 09:48 AM
#5
Re: Retrieving Dimension of a NonClientArea in a MDI Application
 Originally Posted by ovidiucucu
Note that m_hWndMDIClient is a public member of CMDIFrameWnd and represents the handle of MDI Client window.
I don't think that MDI Client Window has non-client area... But the same code will do just fine for the Frame.
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
-
March 7th, 2006, 10:05 AM
#6
Re: Retrieving Dimension of a NonClientArea in a MDI Application
 Originally Posted by VladimirF
I don't think that MDI Client Window has non-client area...
I dind't say that.
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.
-
March 7th, 2006, 10:24 AM
#7
Re: Retrieving Dimension of a NonClientArea in a MDI Application
 Originally Posted by ovidiucucu
I dind't say that.
The OP was referring to "nonclient area of the frame window in an MDI application"...
Sorry, I misread your code...
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|