Subj : Re: MDI problem To : borland.public.cpp.borlandcpp From : "Gary Setter" Date : Tue Oct 21 2003 09:39 am "djwilliams" wrote in message news:3F93E60C.8064BF4B@chelt.ac.uk... > I am writing the application using win32 directly > I have tried creating the Client After the Toolbar etc.. but the same thing is > always happening the client window still fills the whole of the framewindows > client area. Hi D. J. This is the WM_SIZE function that I was talking about. MDIFrameCls is the main frame window. BOOL MDIFrameCls::EvSize(UINT /*sizeType*/, SizeCls size) { //figure size of client area, accomidating status bar PointCls pt(0,0); RectCls statusrect; if ( GetClientRect(HStatusBar,&statusrect)) { SendMessage(HStatusBar, WM_SIZE, 0, 0); //status bar resizes its self size.cy -= statusrect.Height(); } if (ToolBar) { HWND bar = ToolBar->GetHandle(); if (bar) { RectCls rect; if ( GetClientRect(bar,&rect)) { pt.y = rect.Height(); size.cy -= rect.Height(); //status bar resizes its self SendMessage(bar, WM_SIZE, 0, 0); } } } if (ToolBar || HStatusBar) { MoveWindow(HMdiClient, pt.x,pt.y,size.cx,size.cy,true); return TRUE; } return FALSE; } I also needed to make the background brush for the main frame a null brush so that I didn't paint over the toolbar/clientarea/statusbar. Best regards, Gary You can see the result at http://home.att.net/~setterg .