diff --git a/dll/win32/browseui/brandband.cpp b/dll/win32/browseui/brandband.cpp index fc209b73448..e07773e77e9 100644 --- a/dll/win32/browseui/brandband.cpp +++ b/dll/win32/browseui/brandband.cpp @@ -43,7 +43,6 @@ inline void FillSolidRect(HDC dc, const RECT *bounds, COLORREF clr) ::ExtTextOut(dc, 0, 0, ETO_OPAQUE, bounds, NULL, 0, NULL); } -static const int gSmallImageSize = 22; static const int gMediumImageSize = 26; static const int gLargeImageSize = 38; diff --git a/dll/win32/browseui/desktopipc.cpp b/dll/win32/browseui/desktopipc.cpp index 4afb9929e70..47dbe1fcec7 100644 --- a/dll/win32/browseui/desktopipc.cpp +++ b/dll/win32/browseui/desktopipc.cpp @@ -33,15 +33,9 @@ class CProxyDesktop : public CComObjectRootEx, public CWindowImpl < CProxyDesktop, CWindow, CFrameWinTraits > { - IEThreadParamBlock * m_Parameters; - - LPITEMIDLIST m_rootPidl; - public: - CProxyDesktop(IEThreadParamBlock * parameters) : - m_Parameters(parameters) + CProxyDesktop(IEThreadParamBlock * parameters) { - } virtual ~CProxyDesktop() diff --git a/dll/win32/browseui/explorerband.cpp b/dll/win32/browseui/explorerband.cpp index 2c8cbe8da94..c5f76e2ae26 100644 --- a/dll/win32/browseui/explorerband.cpp +++ b/dll/win32/browseui/explorerband.cpp @@ -54,12 +54,6 @@ static BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl) PT_YAGUID == lpPData->type)) || (pidl && pidl->mkid.cb == 0x00))); } -static BOOL _ILIsDesktop (LPCITEMIDLIST pidl) -{ - return (pidl && pidl->mkid.cb == 0x00); -} - - HRESULT GetDisplayName(LPCITEMIDLIST pidlDirectory,TCHAR *szDisplayName,UINT cchMax,DWORD uFlags) { IShellFolder *pShellFolder = NULL; @@ -87,7 +81,7 @@ HRESULT GetDisplayName(LPCITEMIDLIST pidlDirectory,TCHAR *szDisplayName,UINT cch } /* - This is a Windows hack, because shell event messages in Windows gives an + This is a Windows hack, because shell event messages in Windows gives an ill-formed PIDL stripped from useful data that parses incorrectly with SHGetFileInfo. So we need to re-enumerate subfolders until we find one with the same name. */ @@ -150,7 +144,7 @@ Cleanup: } CExplorerBand::CExplorerBand() : - pSite(NULL), fVisible(FALSE), bNavigating(FALSE), dwBandID(0), pidlCurrent(NULL) + pSite(NULL), fVisible(FALSE), bNavigating(FALSE), dwBandID(0), m_isEditing(FALSE), pidlCurrent(NULL) { } @@ -349,7 +343,7 @@ BOOL CExplorerBand::OnTreeItemDeleted(LPNMTREEVIEW pnmtv) /* Destroy memory associated to our node */ NodeInfo* ptr = GetNodeInfo(pnmtv->itemNew.hItem); if (ptr) - { + { ILFree(ptr->relativePidl); ILFree(ptr->absolutePidl); delete ptr; @@ -727,7 +721,6 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp HTREEITEM current; HTREEITEM tmp; HTREEITEM parent; - BOOL found; NodeInfo *nodeData; LPITEMIDLIST relativeChild; TVITEM tvItem; @@ -735,10 +728,9 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp if (!item) return FALSE; - found = FALSE; current = hRoot; parent = NULL; - while(!found) + while (TRUE) { nodeData = GetNodeInfo(current); if (!nodeData) @@ -777,7 +769,7 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp // Try to get a child tmp = TreeView_GetChild(m_hWnd, current); if (tmp) - { + { // We have a child, let's continue with it parent = current; current = tmp; @@ -812,7 +804,6 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp *item = NULL; return FALSE; } - return FALSE; } BOOL CExplorerBand::NavigateToCurrentFolder() @@ -821,7 +812,7 @@ BOOL CExplorerBand::NavigateToCurrentFolder() CComPtr pBrowserService; HRESULT hr; HTREEITEM dummy; - BOOL result; + BOOL result; explorerPidl = NULL; hr = IUnknown_QueryService(pSite, SID_STopLevelBrowser, IID_PPV_ARG(IBrowserService, &pBrowserService)); @@ -1142,7 +1133,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::SetSite(IUnknown *pUnkSite) return E_INVALIDARG; } - pSite = pUnkSite; + pSite = pUnkSite; if (m_hWnd) { @@ -1220,7 +1211,8 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::HasFocusIO() HRESULT STDMETHODCALLTYPE CExplorerBand::TranslateAcceleratorIO(LPMSG lpMsg) { - if (lpMsg->hwnd == m_hWnd) + if (lpMsg->hwnd == m_hWnd || + (m_isEditing && IsChild(lpMsg->hwnd))) { TranslateMessage(lpMsg); DispatchMessage(lpMsg); @@ -1292,6 +1284,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM case TVN_BEGINDRAG: case TVN_BEGINRDRAG: OnTreeItemDragging((LPNMTREEVIEW)lParam, pNotifyHeader->code == TVN_BEGINRDRAG); + break; case TVN_BEGINLABELEDITW: { // TODO: put this in a function ? (mostly copypasta from CDefView) @@ -1311,7 +1304,10 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM hr = pParent->GetAttributesOf(1, &pChild, &dwAttr); if (SUCCEEDED(hr) && (dwAttr & SFGAO_CANRENAME)) + { *theResult = 0; + m_isEditing = TRUE; + } return S_OK; } case TVN_ENDLABELEDITW: @@ -1320,6 +1316,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM NodeInfo *info = GetNodeInfo(dispInfo->item.hItem); HRESULT hr; + m_isEditing = FALSE; *theResult = 0; if (dispInfo->item.pszText) { @@ -1328,8 +1325,8 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM LPCITEMIDLIST pidlChild; hr = SHBindToParent(info->absolutePidl, IID_PPV_ARG(IShellFolder, &pParent), &pidlChild); - if (!SUCCEEDED(hr) || !pParent.p) - return E_FAIL; + if (!SUCCEEDED(hr) || !pParent.p) + return E_FAIL; hr = pParent->SetNameOf(0, pidlChild, dispInfo->item.pszText, SHGDN_INFOLDER, &pidlNew); if(SUCCEEDED(hr) && pidlNew) @@ -1349,6 +1346,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM // Navigate to our new location UpdateBrowser(pidlNewAbs); + ILFree(pidlParent); ILFree(pidlNewAbs); ILFree(pidlNew); *theResult = 1; diff --git a/dll/win32/browseui/explorerband.h b/dll/win32/browseui/explorerband.h index 33d84dde3ba..85f07c696ab 100644 --- a/dll/win32/browseui/explorerband.h +++ b/dll/win32/browseui/explorerband.h @@ -59,6 +59,7 @@ private: BOOL bNavigating; BOOL bFocused; DWORD dwBandID; + BOOL m_isEditing; HIMAGELIST hImageList; HTREEITEM hRoot; HTREEITEM oldSelected; @@ -95,7 +96,7 @@ private: HRESULT UpdateBrowser(LPITEMIDLIST pidlGoto); HTREEITEM InsertItem(HTREEITEM hParent, IShellFolder *psfParent, LPITEMIDLIST pElt, LPITEMIDLIST pEltRelative, BOOL bSort); HTREEITEM InsertItem(HTREEITEM hParent, LPITEMIDLIST pElt, LPITEMIDLIST pEltRelative, BOOL bSort); - BOOL InsertSubitems(HTREEITEM hItem, NodeInfo *pNodeInfo); + BOOL InsertSubitems(HTREEITEM hItem, NodeInfo *pNodeInfo); BOOL NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExpand, BOOL bInsert, BOOL bSelect); BOOL DeleteItem(LPITEMIDLIST toDelete); BOOL RenameItem(HTREEITEM toRename, LPITEMIDLIST newPidl); diff --git a/dll/win32/browseui/shellbars/CBandSite.h b/dll/win32/browseui/shellbars/CBandSite.h index f18cedffb88..c515fbcd054 100644 --- a/dll/win32/browseui/shellbars/CBandSite.h +++ b/dll/win32/browseui/shellbars/CBandSite.h @@ -21,6 +21,11 @@ #pragma once +extern inline BOOL _ILIsDesktop(LPCITEMIDLIST pidl) +{ + return (pidl == NULL || pidl->mkid.cb == 0); +} + class CBandSiteBase : public CComObjectRootEx, public IBandSite, diff --git a/dll/win32/browseui/shellbars/CISFBand.cpp b/dll/win32/browseui/shellbars/CISFBand.cpp index 6e4bb36a7f2..0dd276c23a5 100644 --- a/dll/win32/browseui/shellbars/CISFBand.cpp +++ b/dll/win32/browseui/shellbars/CISFBand.cpp @@ -13,23 +13,6 @@ #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) -// ***Extras*** -/*++ -* @name _ILIsDesktop -* -* Checks whether the given PIDL is of Desktop folder or not. -* -* @param pidl -* PIDL to be checked. -* -* @return True if PIDL is of Desktop, otherwise false. -* -*--*/ -static BOOL _ILIsDesktop(LPCITEMIDLIST pidl) -{ - return (pidl == NULL || pidl->mkid.cb == 0); -} - //***************************************************************************************** // *** CISFBand *** diff --git a/dll/win32/browseui/shellbrowser.cpp b/dll/win32/browseui/shellbrowser.cpp index 25df806e796..2a8ced30fb9 100644 --- a/dll/win32/browseui/shellbrowser.cpp +++ b/dll/win32/browseui/shellbrowser.cpp @@ -167,7 +167,6 @@ HRESULT WINAPI SHBindToFolder(LPCITEMIDLIST path, IShellFolder **newFolder) } static const TCHAR szCabinetWndClass[] = TEXT("CabinetWClass"); -static const TCHAR szExploreWndClass[] = TEXT("ExploreWClass"); class CDockManager; class CShellBrowser; @@ -818,11 +817,6 @@ HRESULT CShellBrowser::BrowseToPIDL(LPCITEMIDLIST pidl, long flags) return S_OK; } -BOOL WINAPI _ILIsDesktop(LPCITEMIDLIST pidl) -{ - return (pidl == NULL || pidl->mkid.cb == 0); -} - BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl) { LPCITEMIDLIST pidlnext; @@ -1402,10 +1396,10 @@ LRESULT CALLBACK CShellBrowser::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, { if (uMsg == WM_NCDESTROY) { - saveWindowProc = reinterpret_cast(::GetWindowLongPtr(hWnd, GWL_WNDPROC)); + saveWindowProc = reinterpret_cast(::GetWindowLongPtr(hWnd, GWLP_WNDPROC)); lResult = pThis->DefWindowProc(uMsg, wParam, lParam); - if (saveWindowProc == reinterpret_cast(::GetWindowLongPtr(hWnd, GWL_WNDPROC))) - ::SetWindowLongPtr(hWnd, GWL_WNDPROC, (LONG_PTR)pThis->m_pfnSuperWindowProc); + if (saveWindowProc == reinterpret_cast(::GetWindowLongPtr(hWnd, GWLP_WNDPROC))) + ::SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)pThis->m_pfnSuperWindowProc); pThis->m_dwState |= WINSTATE_DESTROYED; } else @@ -3487,8 +3481,6 @@ LRESULT CShellBrowser::OnInitMenuPopup(UINT uMsg, WPARAM wParam, LPARAM lParam, SHEnableMenuItem(theMenu, IDM_TOOLS_MAPNETWORKDRIVE, FALSE); SHEnableMenuItem(theMenu, IDM_TOOLS_DISCONNECTNETWORKDRIVE, FALSE); SHEnableMenuItem(theMenu, IDM_TOOLS_SYNCHRONIZE, FALSE); - FIXME("Folder options dialog is stubbed: CORE-11141\n"); - SHEnableMenuItem(theMenu, IDM_TOOLS_FOLDEROPTIONS, FALSE); // Remove when CORE-11141 is fixed. menuIndex = 4; } else if (theMenu == SHGetMenuFromID(fCurrentMenuBar, FCIDM_MENU_HELP)) diff --git a/dll/win32/browseui/toolsband.cpp b/dll/win32/browseui/toolsband.cpp index 03b3609b476..00e3313cdbd 100644 --- a/dll/win32/browseui/toolsband.cpp +++ b/dll/win32/browseui/toolsband.cpp @@ -38,8 +38,6 @@ class CToolsBand : { private: CComPtr fDockSite; - GUID fExecCommandCategory; - CComPtr fExecCommandTarget; HIMAGELIST m_himlNormal; HIMAGELIST m_himlHot; public: @@ -163,7 +161,6 @@ static const int cutImageIndex = 5; static const int copyImageIndex = 6; static const int pasteImageIndex = 7; static const int undoImageIndex = 8; -static const int redoImageIndex = 9; static const int deleteImageIndex = 10; // 11 // 12 @@ -186,13 +183,11 @@ static const int upImageIndex = 28; static const int mapDriveImageIndex = 29; static const int disconnectImageIndex = 30; // 31 -static const int viewsAltImageIndex = 32; // same image as viewsImageIndex // 33 // 34 // 35 // 36 // 37 -static const int viewsAlt2ImageIndex = 38; // same image as viewsAltImageIndex & viewsImageIndex // 39 // 40 // 41