Solved

GetClientRect() without scrollbar and toolbar area?

Posted on 1997-03-18
3
961 Views
Last Modified: 2013-11-20
I'd like to maximze my ChildWindows (MDI app) during startup in vertical direction with fixed horizontal size. I try to get the y size by a call to AfxGetMainWnd->GetClientRect(), but this size seems to be with tool and statusbar, so parts of my childwindows are occluded.
How do I get the correct size to set my childwindows?
0
Comment
Question by:koenig
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
mbhakta earned 30 total points
ID: 1300556
There are various ways of doing this. One way is of doing this is as follows :

Use API GetNextWindow() in a recursive loop to enumerate all the child windows under AfxGetMainWnd(). (Alternately, EnumWindows() can also be used). Once, you have the handle get the classname of that window using GetClassName(). If the class name is 'MDIClient' get the Windowrect and you are done.....

0
 

Author Comment

by:koenig
ID: 1300557
sorry, good, not even a close hit.
don't get confused by the term "maximize"! I want do do a Movewindow() with my own coords and size.
question is: how do I get the maximum y size for my childwindows? GetClientRect() of parent window gives my size without tool-, scroll-, and statusbar...
0
 
LVL 4

Expert Comment

by:mbhakta
ID: 1300558
You had a pretty cryptic question and just 30 points, so what more can you expect ? I can't read your mind. Now that you have explained more about your problems here is a solution.

The clientrect you get after using the technique I have explained earlier should be added to the other child window's clientrect's viz. Toolbar, statusbar , scrollbars or menu(if you want). This is the maximum client area of the AfxGetMainWnd(), so the x and y are the maximum sizes your childwindows can fit in.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 95
Change owner from userA to server Local Administrators 7 62
sumDigits challenge 9 146
only14 challenge 19 75
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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

816 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

8 Experts available now in Live!

Get 1:1 Help Now