Solved

GetClientRect() without scrollbar and toolbar area?

Posted on 1997-03-18
3
981 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 54
not able to insert into temp table 68 178
Separate files macro - Errors on larger data set 18 76
Pressing cancel button with C# UI Automation 3 101
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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 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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 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