You need to intercept several frame messages:
WM_CALCFRAMERECT to calculate the new location of the client. You should send it to the frame superclass then modify the result. This message is invoked during frame formatting and whenever WinCalcFrameRect is called against your frame window handle.
WM_FRAMECTLCOUNT to tell the frame superclass the number of frame controls you expect to format. If you're adding a status line as a child of the frame (below the client, I suspect), you would add 1 to the result returned by your frame superclass.
WM_FORMATFRAME is where you actually position/size the frame controls. The message gives you an array of SWP's. Call your frame superclass and modify the result (in your case, I would expect only FID_CLIENT and your status line).
Sample follows...
/* * FYI, WinDefFrameProc is just a macro I defined to * call my superclass frame window procedure, ie, * (*vpfnFrameWndProc) (h,m,p1,p2). * * This example splits the client area space 1/3 * and 2/3 horizontally with the old client area * and a new sibling. */ case WM_CALCFRAMERECT: mr = WinDefFrameProc(hwnd, msg, mp1, mp2); /* * Calculate the position of the client rectangle * Otherwise, we'll see a lot of redraw when we move the * client during WM_FORMATFRAME. */ if (mr && mp2) { prectl = (PRECTL) mp1; prectl->xLeft += ((prectl->xRight - prectl->xLeft) / 3); } break; case WM_FORMATFRAME: sCount = (SHORT) WinDefFrameProc(hwnd, msg, mp1, mp2); /* * Reformat the frame to move the client * over and make room for the his/her sibling. */ pswp = (PSWP) mp1; pswpClient = pswp + sCount - 1; pswpNew = pswpClient + 1; *pswpNew = *pswpClient; swpClient = *pswpClient; pswpNew->hwnd = WinWindowFromID(hwnd, ID_SIBLING); pswpNew->cx = pswpClient->cx / 3; pswpClient->x = pswpNew->x + pswpNew->cx - 1; pswpClient->cx = swpClient.cx - pswpNew->cx + 1; sCount++; mr = MRFROMSHORT(sCount); break; case WM_QUERYFRAMECTLCOUNT: sCount = (SHORT) WinDefFrameProc(hwnd, msg, mp1, mp2); sCount++; mr = MRFROMSHORT(sCount); break;
Credit: Dan Kehn