+ // Get the minimum window sizes
+// GetWindowRect(hMainWnd, &rc);
+// nMinimumWidth = (rc.right - rc.left);
+// nMinimumHeight = (rc.bottom - rc.top);
+
+ // Create the status bar
+ hStatusWnd = CreateStatusWindow(WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBT_NOBORDERS,
+ "", hMainWnd, STATUS_WINDOW);
+ if (!hStatusWnd)
+ return FALSE;
+
+ // Create the status bar panes
+ nParts[0] = 100;
+ nParts[1] = 210;
+ nParts[2] = 400;
+ SendMessage(hStatusWnd, SB_SETPARTS, 3, (long)nParts);
+
+
+ ShowWindow(hMainWnd, nCmdShow);
+ UpdateWindow(hMainWnd);
+ return TRUE;
+}
+
+
+// OnSize()
+// This function handles all the sizing events for the application
+// It re-sizes every window, and child window that needs re-sizing
+void OnSize(UINT nType, int cx, int cy)
+{
+ int nParts[3];
+ int nXDifference;
+ int nYDifference;
+ RECT rc;
+
+ if (nType == SIZE_MINIMIZED)
+ return;
+
+ nXDifference = cx - nOldWidth;
+ nYDifference = cy - nOldHeight;
+ nOldWidth = cx;
+ nOldHeight = cy;
+
+ // Update the status bar size
+ GetWindowRect(hStatusWnd, &rc);
+ SendMessage(hStatusWnd, WM_SIZE, nType, MAKELPARAM(cx, cy + (rc.bottom - rc.top)));
+
+ // Update the status bar pane sizes
+ nParts[0] = bInMenuLoop ? -1 : 100;
+ nParts[1] = 210;
+ nParts[2] = cx;
+ SendMessage(hStatusWnd, SB_SETPARTS, bInMenuLoop ? 1 : 3, (long)nParts);
+}
+
+void OnEnterMenuLoop(HWND hWnd)
+{
+ int nParts;
+
+ // Update the status bar pane sizes
+ nParts = -1;
+ SendMessage(hStatusWnd, SB_SETPARTS, 1, (long)&nParts);
+ bInMenuLoop = TRUE;
+ SendMessage(hStatusWnd, SB_SETTEXT, (WPARAM)0, (LPARAM)_T(""));
+}