Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

toolbar and statusbar has no effect on CMDIFrameWnd::GetClientRect()

29 views
Skip to first unread message

Gytis Jakutonis

unread,
Feb 20, 2003, 7:28:24 AM2/20/03
to
GetClientRect() returns the same values when toolbar/statusbar are visible
or hidden. How to calculate MDI frame area without toolbar and statusbar ? I
know that I can remove heights of these controls from the total height, but
maybe there is a standart call.


Scott McPhillips

unread,
Feb 20, 2003, 7:49:08 AM2/20/03
to

RepositionBars with the CWnd::reposQuery flag returns the remaining
rect.

--
Scott McPhillips [VC++ MVP]

Ajay Kalra

unread,
Feb 20, 2003, 1:15:27 PM2/20/03
to
Thats because CControlBar derivatives occupy the client area (unusual).
Scott's reply should work fine.

--
Ajay Kalra [MVP - VC++]
ajay...@yahoo.com


"Gytis Jakutonis" <jaku...@mail.lt> wrote in message
news:eFxzzJN2...@TK2MSFTNGP09.phx.gbl...

Gytis Jakutonis

unread,
Feb 21, 2003, 3:44:30 AM2/21/03
to
thanks, RepositionBars calculates expected size, but I still have a small
problem: RepositionBars returns a bit bigger rect than I expect.

I've tested this by creating new mdi child and streching it to fill the
entire client area in the normal state - getwindowrect() for the child frame
should be equal to repositionbars() result, but - reposition bars gives rect
which is 4 pts (on my windows) larger in height than child window rect.

So currently I have a litle 'hack':

RepositionBars(0, UINT_MAX, UINT_MAX, reposQuery, &clientRect);
clientRect.bottom -= 4;

Any ideas about those 4 pts? My mdi frame has menu, statusbar and rebar(top)
with several tollbars in it. thanks in advance.

"Scott McPhillips" <scot...@mvps.org> wrote in message
news:3E54CEC4...@mvps.org...

0 new messages