From 71e03db3fe82e0c0d1343b4e21bce9fc8378decd Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sat, 9 Aug 2003 23:12:30 +0000 Subject: [PATCH] fix FOLDERSETTINGS usage svn path=/trunk/; revision=5501 --- .../system/explorer/desktop/desktop.cpp | 23 ++++++++++++------- .../system/explorer/shell/shellbrowser.cpp | 4 ++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/reactos/subsys/system/explorer/desktop/desktop.cpp b/reactos/subsys/system/explorer/desktop/desktop.cpp index a2a2c1af9fe..423895179f2 100644 --- a/reactos/subsys/system/explorer/desktop/desktop.cpp +++ b/reactos/subsys/system/explorer/desktop/desktop.cpp @@ -101,33 +101,40 @@ LRESULT DesktopWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) case WM_CREATE: { HRESULT hr = Desktop()->CreateViewObject(_hwnd, IID_IShellView, (void**)&_pShellView); - HWND hWndListView = 0; + HWND hWndView = 0; if (SUCCEEDED(hr)) { FOLDERSETTINGS fs; - fs.ViewMode = FWF_DESKTOP|FWF_TRANSPARENT|FWF_NOSUBFOLDERS|FWF_BESTFITWINDOW|FWF_ABBREVIATEDNAMES; - fs.fFlags = FVM_ICON; + fs.ViewMode = FVM_ICON; + fs.fFlags = FWF_DESKTOP|FWF_TRANSPARENT|FWF_NOCLIENTEDGE|FWF_NOSCROLL|FWF_BESTFITWINDOW|FWF_SNAPTOGRID; RECT rect; GetClientRect(_hwnd, &rect); - hr = _pShellView->CreateViewWindow(NULL, &fs, this, &rect, &hWndListView); + hr = _pShellView->CreateViewWindow(NULL, &fs, this, &rect, &hWndView); + + //TODO: use IShellBrowser::GetViewStateStream() to restore previous view state if (SUCCEEDED(hr)) { - HWND hwndFolderView = ::GetNextWindow(hWndListView, GW_CHILD); + _pShellView->UIActivate(SVUIA_ACTIVATE_FOCUS); + + HWND hwndFolderView = ::GetNextWindow(hWndView, GW_CHILD); ShowWindow(hwndFolderView, SW_SHOW); } } - - if (hWndListView && SetShellWindowEx) - SetShellWindowEx(_hwnd, hWndListView); + + if (hWndView && SetShellWindowEx) + SetShellWindowEx(_hwnd, hWndView); else if (SetShellWindow) SetShellWindow(_hwnd); break;} case WM_DESTROY: + + //TODO: use IShellBrowser::GetViewStateStream() and _pShellView->SaveViewState() to store view state + if (SetShellWindow) SetShellWindow(0); break; diff --git a/reactos/subsys/system/explorer/shell/shellbrowser.cpp b/reactos/subsys/system/explorer/shell/shellbrowser.cpp index 615e3f1fcd5..17ea3e4cca1 100644 --- a/reactos/subsys/system/explorer/shell/shellbrowser.cpp +++ b/reactos/subsys/system/explorer/shell/shellbrowser.cpp @@ -359,8 +359,8 @@ void ShellBrowserChild::OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv) if (pLastShellView) pLastShellView->GetCurrentInfo(&fs); else { - fs.ViewMode = FWF_SNAPTOGRID; - fs.fFlags = FVM_DETAILS; + fs.ViewMode = FVM_DETAILS; + fs.fFlags = 0; } HRESULT hr = folder->CreateViewObject(_hwnd, IID_IShellView, (void**)&_pShellView);