Solved

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

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now