well not to be contridictory but ya its probably your math lol.

remember that the MDI client window may or may not be at 0,0. the toolbar and switchbar are child controls of the frame window. essentially what you do is adjust the mdi pos wich seems like you have then adjust its height based on its height - the height of the new child control (the docked window). for example if the child window is 100 tall you move the MDI down 100 ans shorten its height by 100. the best solution i would recommend would be to use the DeferWindowPos api. you can position and size multiple windows at once (namely the child window and the MDI)

also note that other dll's (ktools is a prime example) also handles sizing the mdi and the 2 dll's wont play nice togethor. if its just for you then i sposse it doesnt matter much.

another method you could use would be to get the client rect of the frame window then subtract the sum of the height of each control (toolbar switchbar and the child window) then use that as your new cy value in SetWindowPos (or DeferWindowPos). also note that if you use these function do not use the HWND_TOPMOST parameter. depending on wich windows version your using setting this with an MDI client window cna cause some drawing issues (cant remember why but you can see it on MSDN)

Last edited by Narusegawa_Naru; 04/11/03 09:47 PM.

Have Fun smile