Subj : Re: MDI problem To : borland.public.cpp.borlandcpp From : djwilliams Date : Mon Oct 20 2003 03:41 pm I am writing the application using win32 directly I have previously written a similar app using Delphi and I am using this project as a learning curve to learn more about the internals of the API. I have basically done everything via the standard method I have created the frameWindow in the WinMain() function using hframewnd= CreateWindowEx(NULL,szWinName, //Window name "Frame window", WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN, //Normal window style CW_USEDEFAULT, //x Coordinate CW_USEDEFAULT, //Y Coordinate CW_USEDEFAULT, //Width let windows decide CW_USEDEFAULT, //Height let windows decide HWND_DESKTOP, // parent window NULL, //No Menu hThisInst, //Handle of this instance NULL//Additional creation info ); and created the toolbar and client windows in the WM_CREATE message loop of the frameWindow's CALLBACK function //It doesn't seem to matter what size is used for the client windows size X,Y or its Coordinates X,Y, it still //fills the whole of the framewindows client area HWND createClient(HWND hwnd, HINSTANCE hInst,CLIENTCREATESTRUCT clientCreateStruct) { clientCreateStruct.hWindowMenu=0; clientCreateStruct.idFirstChild= ID_CHILDWND; return CreateWindowEx(NULL,"MDICLIENT", //Window name NULL, //no window title text WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE, // style CW_USEDEFAULT,//0, //x Coordinate CW_USEDEFAULT,//Y Coordinate CW_USEDEFAULT, //Width let windows decide CW_USEDEFAULT,//0,//Height let windows decide hwnd,//hframewnd doesn't work as handle here NULL,//"MyMenu",// //No Menu hInst, //Handle of this instance &clientCreateStruct //additional arguments ); } HWND createToolbar(HWND hwnd, HINSTANCE hInst) { InitToolbar(); //Initialise the toolbar structures. return CreateToolbarEx(hwnd, WS_VISIBLE| WS_CHILD|WS_BORDER, IDM_TOOLBAR, NUMBUTTONS, hInst,//hThisInst, IDTB_BMP, tbButtons, NUMBUTTONS, 16,16,16,16, sizeof(TBBUTTON)); } 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. Gary Setter wrote: > "djwilliams" wrote in message > news:3F939EDA.2815A937@chelt.ac.uk... > > Hi > > I am writing an application using MDI windows and have created the > > framewindow, client windows, and child windows succesfully, however the > > problem I am getting is the framewindow's toolbar is being over written > > by the child windows, the problem seems to be that the client window > > also occupies the toolbars area. Is there any way to provide anchors as > > in Delphi to cause the Client windows X,Y start positions to be under > > the Toolbar?. > > > > Can you give us more details of how you created the app? Did you use > AppExpert, or your own hand crafted Owl (5.1?), or did you use the Win32 > directly? > > I've never had a problem of that sort with Owl code. I did write a Win32 app > and found that I needed to adjust the client size when the main frame window > received the WM_SIZE event. > > Maybe the best thing is to make a small sample, upload to your account or to > attachments and let the masses look at it. > > HTH > Gary .