Index: rapps.h =================================================================== --- rapps.h (revision 57565) +++ rapps.h (working copy) @@ -88,6 +88,11 @@ INT Top; INT Right; INT Bottom; + INT vSplitterPos; + INT hSplitterPos; + INT iNameColumnSize; + INT iVersionColumnSize; + INT iDescriptionColumnSize; } SETTINGS_INFO, *PSETTINGS_INFO; Index: winmain.c =================================================================== --- winmain.c (revision 57565) +++ winmain.c (working copy) @@ -29,6 +29,11 @@ pSettingsInfo->Top = 0; pSettingsInfo->Right = 680; pSettingsInfo->Bottom = 450; + pSettingsInfo->vSplitterPos = 200; + pSettingsInfo->hSplitterPos = 500; + pSettingsInfo->iNameColumnSize = 200; + pSettingsInfo->iVersionColumnSize = 100; + pSettingsInfo->iDescriptionColumnSize = 220; } static BOOL @@ -68,6 +73,15 @@ SettingsInfo.Right = wp.rcNormalPosition.right; SettingsInfo.Bottom = wp.rcNormalPosition.bottom; SettingsInfo.Maximized = (IsZoomed(hwnd) || (wp.flags & WPF_RESTORETOMAXIMIZED)); + + /* Save splitter settings */ + SettingsInfo.vSplitterPos = GetWindowWidth(hTreeView); + SettingsInfo.hSplitterPos = GetHSplitterPos(); + + /* Save list view column width*/ + SettingsInfo.iNameColumnSize = ListView_GetColumnWidth(hListView, 0); + SettingsInfo.iVersionColumnSize = ListView_GetColumnWidth(hListView, 1); + SettingsInfo.iDescriptionColumnSize = ListView_GetColumnWidth(hListView, 2); } if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"Software\\ReactOS\\rapps", 0, NULL, @@ -311,7 +325,7 @@ SettingsInfo.Right - SettingsInfo.Left, SettingsInfo.Bottom - SettingsInfo.Top, TRUE); - if (SettingsInfo.Maximized) ShowWindow(hwnd, SW_MAXIMIZE); + if (SettingsInfo.Maximized) PostMessage(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0); } if (CreateStatusBar(hwnd) && @@ -331,6 +345,21 @@ LoadStringW(hInst, IDS_APPS_COUNT, szBuffer2, sizeof(szBuffer2) / sizeof(WCHAR)); swprintf(szBuffer1, szBuffer2, ListView_GetItemCount(hListView)); SetStatusBarText(szBuffer1); + + if (SettingsInfo.vSplitterPos > 0) + SetWindowPos(hTreeView, 0, 0, 0, SettingsInfo.vSplitterPos, GetWindowHeight(hTreeView), SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); + + if (SettingsInfo.hSplitterPos > 0) + SetHSplitterPos(SettingsInfo.hSplitterPos); + + /* Update listview column width */ + if (SettingsInfo.iNameColumnSize > 0) + (void)ListView_SetColumnWidth(hListView, 0, SettingsInfo.iNameColumnSize); + if (SettingsInfo.iVersionColumnSize > 0) + (void)ListView_SetColumnWidth(hListView, 1, SettingsInfo.iVersionColumnSize); + if (SettingsInfo.iDescriptionColumnSize > 0) + (void)ListView_SetColumnWidth(hListView, 2, SettingsInfo.iDescriptionColumnSize); + return TRUE; } @@ -438,8 +467,6 @@ { HDWP hdwp = BeginDeferWindowPos(5); INT SearchBarWidth = GetWindowWidth(hSearchBar); - INT RichPos = GetWindowHeight(hRichEdit); - INT NewPos = HIWORD(lParam) - (RichPos + SPLIT_WIDTH + GetWindowHeight(hStatusBar)); INT VSplitterPos; /* Size status bar */ @@ -476,14 +503,6 @@ HIWORD(lParam) - GetWindowHeight(hToolBar) - GetWindowHeight(hStatusBar), SWP_NOZORDER|SWP_NOACTIVATE); - while (NewPos < SPLIT_WIDTH + GetWindowHeight(hToolBar)) - { - RichPos--; - NewPos = HIWORD(lParam) - (RichPos + - SPLIT_WIDTH + GetWindowHeight(hStatusBar)); - } - SetHSplitterPos(NewPos); - /* Size ListView */ DeferWindowPos(hdwp, hListView, @@ -501,7 +520,7 @@ VSplitterPos + SPLIT_WIDTH, GetHSplitterPos() + SPLIT_WIDTH, LOWORD(lParam) - (VSplitterPos + SPLIT_WIDTH), - RichPos, + ((GetClientWindowHeight(hMainWnd) - GetWindowHeight(hStatusBar)) - (GetHSplitterPos() + SPLIT_WIDTH)), SWP_NOZORDER|SWP_NOACTIVATE); /* Size horizontal splitter bar */ @@ -685,6 +704,7 @@ case WM_SIZE: { + //if ((GetClientWindowHeight(hMainWnd) - GetWindowHeight(hStatusBar) - SPLIT_WIDTH) < (GetHSplitterPos() + GetWindowHeight(hRichEdit))) if ((GetClientWindowHeight(hMainWnd) - GetWindowHeight(hStatusBar) - SPLIT_WIDTH) < GetHSplitterPos()) { INT NewSplitPos = GetClientWindowHeight(hwnd) - 100 - GetWindowHeight(hStatusBar) - SPLIT_WIDTH; @@ -714,6 +734,7 @@ if (pRect->bottom-pRect->top < 300) pRect->bottom = pRect->top + 300; + RedrawWindow(hwnd, 0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN); return TRUE; }