- toolbarRect = clientRect;
- if (fClientBars[x].borderSpace.top != 0)
- toolbarRect.bottom = toolbarRect.top + fClientBars[x].borderSpace.top;
- else if (fClientBars[x].borderSpace.bottom != 0)
- toolbarRect.top = toolbarRect.bottom - fClientBars[x].borderSpace.bottom;
- if (fClientBars[x].borderSpace.left != 0)
- toolbarRect.right = toolbarRect.left + fClientBars[x].borderSpace.left;
- else if (fClientBars[x].borderSpace.right != 0)
- toolbarRect.left = toolbarRect.right - fClientBars[x].borderSpace.right;
- ::SetWindowPos(fClientBars[x].hwnd, NULL, toolbarRect.left, toolbarRect.top,
- toolbarRect.right - toolbarRect.left,
- toolbarRect.bottom - toolbarRect.top, SWP_NOOWNERZORDER | SWP_NOZORDER);
- clientRect.top += fClientBars[x].borderSpace.top;
- clientRect.left += fClientBars[x].borderSpace.left;
- clientRect.bottom += fClientBars[x].borderSpace.bottom;
- clientRect.right += fClientBars[x].borderSpace.right;
+ RECT toolbarRect = clientRect;
+ if (borderSpace.top != 0)
+ {
+ toolbarRect.bottom = toolbarRect.top + borderSpace.top;
+ }
+ else if (borderSpace.bottom != 0)
+ {
+ toolbarRect.top = toolbarRect.bottom - borderSpace.bottom;
+ }
+ else if (borderSpace.left != 0)
+ {
+ toolbarRect.right = toolbarRect.left + borderSpace.left;
+ }
+ else if (borderSpace.right != 0)
+ {
+ toolbarRect.left = toolbarRect.right - borderSpace.right;
+ }
+
+ ::SetWindowPos(hwnd, NULL,
+ toolbarRect.left,
+ toolbarRect.top,
+ toolbarRect.right - toolbarRect.left,
+ toolbarRect.bottom - toolbarRect.top,
+ SWP_NOOWNERZORDER | SWP_NOZORDER);
+
+ if (borderSpace.top != 0)
+ {
+ clientRect.top = toolbarRect.bottom;
+ }
+ else if (borderSpace.bottom != 0)
+ {
+ clientRect.bottom = toolbarRect.top;
+ }
+ else if (borderSpace.left != 0)
+ {
+ clientRect.left = toolbarRect.right;
+ }
+ else if (borderSpace.right != 0)
+ {
+ clientRect.right = toolbarRect.left;
+ }