Doh. I should've tried with actual values. My calculations are off somehow. It works if I substitute other values for the 2 vars in the MoveWindow. Now I gotta figure out where I'm screwing up the values.
Code:
case WM_SIZE:
{
SendMessage(hStatus, WM_SIZE, 0, 0);
RECT MainRect; memset(&MainRect,0,sizeof(MainRect));
GetClientRect(hwnd,&MainRect);
RECT StatusRect; memset(&StatusRect,0,sizeof(StatusRect));
GetWindowRect(hStatus,&StatusRect);
MainRect.right -= StatusRect.right - StatusRect.left;
MainRect.bottom -= StatusRect.bottom - StatusRect.top;
MoveWindow(hListData, 0, 0, MainRect.right, MainRect.bottom, TRUE);
Edit: I got it now.
Code:
case WM_SIZE:
{
SendMessage(hStatus, WM_SIZE, 0, 0);
RECT StatusRect; memset(&StatusRect,0,sizeof(StatusRect));
GetWindowRect(hStatus,&StatusRect);
MoveWindow(hListData, 0, 0, LOWORD(lParam), HIWORD(lParam) - (StatusRect.bottom - StatusRect.top), TRUE);