Link to home
Start Free TrialLog in
Avatar of koenig
koenig

asked on

GetClientRect() without scrollbar and toolbar area?

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?
ASKER CERTIFIED SOLUTION
Avatar of mbhakta
mbhakta

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of koenig
koenig

ASKER

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...
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.