Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 1998-10-27
4
Medium Priority
?
271 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 200 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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

927 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