Solved

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

Posted on 1998-10-27
4
233 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
  • 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
function returning CString in a regular win32 DLL 8 178
ODBC Connection Logging, ADO.NET 6 64
sum67 challenge 35 97
Problem to event 3 96
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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

770 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