I have created an MDI Client and I have a toolbar and a statusbar too. I am having difficulty with the window message WM_SIZE. I know that if you have a MDI client that you must be careful when resizing that you don't ruin the toolbar and the statusbar like I am doing. You can see them both, it's just that they are not updated and MDI Windows draw over them.
Can anyone tell me what I'm doing wrong?
Code:
case WM_SIZE:
SendMessage(hToolbar, TB_AUTOSIZE, 0, 0);
SendMessage(hStatusBar, WM_SIZE, 0, 0);
GetClientRect(hWnd, &rectClient);
GetWindowRect(hStatusBar, &rectStatus);
GetWindowRect(hToolbar, &rectTool);
uToolHeight = rectTool.bottom - rectTool.top;
uStatusHeight = rectStatus.bottom - rectStatus.top;
uClientAlreaHeight = rectClient.bottom;
MoveWindow(hMDIWnd, 0, uToolHeight, rectClient.right, uClientAlreaHeight - uStatusHeight - uToolHeight, TRUE);
break;
}
return DefFrameProc(hWnd, hMDIWnd, message, wParam, lParam);
SendMessage(hToolbar, TB_AUTOSIZE, 0, 0);
SendMessage(hStatusBar, WM_SIZE, 0, 0);
GetClientRect(hWnd, &rectClient);
GetWindowRect(hStatusBar, &rectStatus);
GetWindowRect(hToolbar, &rectTool);
uToolHeight = rectTool.bottom - rectTool.top;
uStatusHeight = rectStatus.bottom - rectStatus.top;
uClientAlreaHeight = rectClient.bottom;
MoveWindow(hMDIWnd, 0, uToolHeight, rectClient.right, uClientAlreaHeight - uStatusHeight - uToolHeight, TRUE);
break;
}
return DefFrameProc(hWnd, hMDIWnd, message, wParam, lParam);
Can anyone tell me what I'm doing wrong?