Actually, the statusbar pretty much knows how to size itself when sent a WM_SIZE message with out need for dimensions. The richedit control needs to be sized/positioned to account for the statusbar's dimensions, specifically its height, and, while SetWindowPos is certainly a good option, MoveWindow is simpler to use. Something like:
Code:
case WM_SIZE:
{
SendMessage(hStatusbar,WM_SIZE,0,0);
RECT rc;
GetClientRect(hStatusbar,&rc);
int statbar_height = rc.bottom - rc.top;
MoveWindow(hRichedit,0,0,LOWORD(lParam),HIWORD(lParam) - statbar_height,0);
return 0;
}