Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 113
VBA "SendKeys" Syntax for Multiple Keystrokes 7 103
wordmultiple challenge 12 121
how to use laptop or pad camera in vb.net windows application 2 55
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

895 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

12 Experts available now in Live!

Get 1:1 Help Now