Solved

How do I find available "client" real estate inside a frame window?

Posted on 1998-10-27
4
248 Views
Last Modified: 2013-11-20
I need to know how to find out how big the available area is inside a frame window, i.e., window size - title bar - menu - status - all docked toolbars = area I need to find. This is not just the area returned by GetClientRect()...the rect returned by this function includes that used by the docked toolbars.
0
Comment
Question by:postrowski
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 7

Expert Comment

by:psdavis
ID: 1323906
GetWindowRect.

The dimensions are given in screen coordinates relative to the upper-left corner of the display screen. The dimensions of the caption, border, and scroll bars, if present, are included.

Phillip
0
 

Author Comment

by:postrowski
ID: 1323907
Actually, I need the area WITHOUT the title, status, menu, and toolbars. If it's not clear in the question the hyphens I used are supposed to be minus signs, I did not intend to merely list the elements of a window.

     Desired Area = (Total window area) - (title bar) - (menu area) - (status bar area) - (docked toolbar areas)
0
 
LVL 7

Expert Comment

by:psdavis
ID: 1323908
You're right.  I thought the dashes were hyphens.

So you are wanting the area defined by GetClientRect - (docked toolbar areas) correct?

A way to do this is to get a CRect from GetClientRect, get a CRect from the dialog bars, and then use IntersectRect/UnionRect to get the final result.

Phillip

0
 
LVL 12

Accepted Solution

by:
migel earned 100 total points
ID: 1323909
Try to use
void CWnd::RepositionBars(UINT nIDFirst, UINT nIDLast, UINT nIDLeftOver, UINT nFlags, LPRECT lpRectParam, LPCRECT lpRectClient)

for example:
RECT rect; // wanted rectangle
RepositionBars(0, 0xffff, AFX_IDW_PANE_FIRST, reposQuery, &rect);

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Process filename extension 3 209
maven archtype selection in eclipse 1 58
lucky13 challenge 11 159
fizzArray2 challenge 1 103
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question