[BROWSEUI] Add 'm_' prefix to CExplorerBand members (#2524)

Add 'm_' prefix to the variable members of class CExplorerBand for readability.
CORE-13950
This commit is contained in:
Katayama Hirofumi MZ 2020-04-10 23:08:31 +09:00 committed by GitHub
parent 60959e34aa
commit d04f2e5209
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 98 additions and 92 deletions

View file

@ -2,6 +2,7 @@
* ReactOS Explorer * ReactOS Explorer
* *
* Copyright 2016 Sylvain Deverre <deverre dot sylv at gmail dot com> * Copyright 2016 Sylvain Deverre <deverre dot sylv at gmail dot com>
* Copyright 2020 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -143,16 +144,20 @@ Cleanup:
return hr; return hr;
} }
CExplorerBand::CExplorerBand() : CExplorerBand::CExplorerBand()
pSite(NULL), fVisible(FALSE), bNavigating(FALSE), dwBandID(0), pidlCurrent(NULL) : m_pSite(NULL)
, m_fVisible(FALSE)
, m_bNavigating(FALSE)
, m_dwBandID(0)
, m_pidlCurrent(NULL)
{ {
} }
CExplorerBand::~CExplorerBand() CExplorerBand::~CExplorerBand()
{ {
if(pidlCurrent) if (m_pidlCurrent)
{ {
ILFree(pidlCurrent); ILFree(m_pidlCurrent);
} }
} }
@ -164,7 +169,7 @@ void CExplorerBand::InitializeExplorerBand()
CComPtr<IWebBrowser2> browserService; CComPtr<IWebBrowser2> browserService;
SHChangeNotifyEntry shcne; SHChangeNotifyEntry shcne;
hr = SHGetDesktopFolder(&pDesktop); hr = SHGetDesktopFolder(&m_pDesktop);
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
return; return;
@ -180,18 +185,18 @@ void CExplorerBand::InitializeExplorerBand()
TreeView_SetImageList(m_hWnd, (HIMAGELIST)piml, TVSIL_NORMAL); TreeView_SetImageList(m_hWnd, (HIMAGELIST)piml, TVSIL_NORMAL);
// Insert the root node // Insert the root node
hRoot = InsertItem(0, pDesktop, pidl, pidl, FALSE); m_hRoot = InsertItem(0, m_pDesktop, pidl, pidl, FALSE);
if (!hRoot) if (!m_hRoot)
{ {
ERR("Failed to create root item\n"); ERR("Failed to create root item\n");
return; return;
} }
NodeInfo* pNodeInfo = GetNodeInfo(hRoot); NodeInfo* pNodeInfo = GetNodeInfo(m_hRoot);
// Insert child nodes // Insert child nodes
InsertSubitems(hRoot, pNodeInfo); InsertSubitems(m_hRoot, pNodeInfo);
TreeView_Expand(m_hWnd, hRoot, TVE_EXPAND); TreeView_Expand(m_hWnd, m_hRoot, TVE_EXPAND);
// Navigate to current folder position // Navigate to current folder position
NavigateToCurrentFolder(); NavigateToCurrentFolder();
@ -199,23 +204,23 @@ void CExplorerBand::InitializeExplorerBand()
// Register shell notification // Register shell notification
shcne.pidl = pidl; shcne.pidl = pidl;
shcne.fRecursive = TRUE; shcne.fRecursive = TRUE;
shellRegID = SHChangeNotifyRegister( m_shellRegID = SHChangeNotifyRegister(
m_hWnd, m_hWnd,
SHCNRF_ShellLevel | SHCNRF_InterruptLevel | SHCNRF_RecursiveInterrupt, SHCNRF_ShellLevel | SHCNRF_InterruptLevel | SHCNRF_RecursiveInterrupt,
SHCNE_DISKEVENTS | SHCNE_RENAMEFOLDER | SHCNE_RMDIR | SHCNE_MKDIR, SHCNE_DISKEVENTS | SHCNE_RENAMEFOLDER | SHCNE_RMDIR | SHCNE_MKDIR,
WM_USER_SHELLEVENT, WM_USER_SHELLEVENT,
1, 1,
&shcne); &shcne);
if (!shellRegID) if (!m_shellRegID)
{ {
ERR("Something went wrong, error %08x\n", GetLastError()); ERR("Something went wrong, error %08x\n", GetLastError());
} }
// Register browser connection endpoint // Register browser connection endpoint
hr = IUnknown_QueryService(pSite, SID_SWebBrowserApp, IID_PPV_ARG(IWebBrowser2, &browserService)); hr = IUnknown_QueryService(m_pSite, SID_SWebBrowserApp, IID_PPV_ARG(IWebBrowser2, &browserService));
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
return; return;
hr = AtlAdvise(browserService, dynamic_cast<IDispatch*>(this), DIID_DWebBrowserEvents, &adviseCookie); hr = AtlAdvise(browserService, dynamic_cast<IDispatch*>(this), DIID_DWebBrowserEvents, &m_adviseCookie);
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
return; return;
@ -229,16 +234,16 @@ void CExplorerBand::DestroyExplorerBand()
TRACE("Cleaning up explorer band ...\n"); TRACE("Cleaning up explorer band ...\n");
hr = IUnknown_QueryService(pSite, SID_SWebBrowserApp, IID_PPV_ARG(IWebBrowser2, &browserService)); hr = IUnknown_QueryService(m_pSite, SID_SWebBrowserApp, IID_PPV_ARG(IWebBrowser2, &browserService));
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
return; return;
hr = AtlUnadvise(browserService, DIID_DWebBrowserEvents, adviseCookie); hr = AtlUnadvise(browserService, DIID_DWebBrowserEvents, m_adviseCookie);
/* Remove all items of the treeview */ /* Remove all items of the treeview */
RevokeDragDrop(m_hWnd); RevokeDragDrop(m_hWnd);
TreeView_DeleteAllItems(m_hWnd); TreeView_DeleteAllItems(m_hWnd);
pDesktop = NULL; m_pDesktop = NULL;
hRoot = NULL; m_hRoot = NULL;
TRACE("Cleanup done !\n"); TRACE("Cleanup done !\n");
} }
@ -262,7 +267,7 @@ HRESULT CExplorerBand::ExecuteCommand(CComPtr<IContextMenu>& menu, UINT nCmd)
HWND browserWnd; HWND browserWnd;
HRESULT hr; HRESULT hr;
hr = IUnknown_QueryService(pSite, SID_SShellBrowser, IID_PPV_ARG(IOleWindow, &pBrowserOleWnd)); hr = IUnknown_QueryService(m_pSite, SID_SShellBrowser, IID_PPV_ARG(IOleWindow, &pBrowserOleWnd));
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
return hr; return hr;
@ -287,7 +292,7 @@ HRESULT CExplorerBand::UpdateBrowser(LPITEMIDLIST pidlGoto)
CComPtr<IShellBrowser> pBrowserService; CComPtr<IShellBrowser> pBrowserService;
HRESULT hr; HRESULT hr;
hr = IUnknown_QueryService(pSite, SID_STopLevelBrowser, IID_PPV_ARG(IShellBrowser, &pBrowserService)); hr = IUnknown_QueryService(m_pSite, SID_STopLevelBrowser, IID_PPV_ARG(IShellBrowser, &pBrowserService));
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
return hr; return hr;
@ -295,10 +300,10 @@ HRESULT CExplorerBand::UpdateBrowser(LPITEMIDLIST pidlGoto)
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
return hr; return hr;
if(pidlCurrent) if (m_pidlCurrent)
{ {
ILFree(pidlCurrent); ILFree(m_pidlCurrent);
pidlCurrent = ILClone(pidlGoto); m_pidlCurrent = ILClone(pidlGoto);
} }
return hr; return hr;
} }
@ -309,7 +314,7 @@ BOOL CExplorerBand::OnTreeItemExpanding(LPNMTREEVIEW pnmtv)
NodeInfo *pNodeInfo; NodeInfo *pNodeInfo;
if (pnmtv->action == TVE_COLLAPSE) { if (pnmtv->action == TVE_COLLAPSE) {
if (pnmtv->itemNew.hItem == hRoot) if (pnmtv->itemNew.hItem == m_hRoot)
{ {
// Prenvent root from collapsing // Prenvent root from collapsing
pnmtv->itemNew.mask |= TVIF_STATE; pnmtv->itemNew.mask |= TVIF_STATE;
@ -356,7 +361,7 @@ void CExplorerBand::OnSelectionChanged(LPNMTREEVIEW pnmtv)
NodeInfo* pNodeInfo = GetNodeInfo(pnmtv->itemNew.hItem); NodeInfo* pNodeInfo = GetNodeInfo(pnmtv->itemNew.hItem);
/* Prevents navigation if selection is initiated inside the band */ /* Prevents navigation if selection is initiated inside the band */
if (bNavigating) if (m_bNavigating)
return; return;
UpdateBrowser(pNodeInfo->absolutePidl); UpdateBrowser(pNodeInfo->absolutePidl);
@ -461,9 +466,9 @@ Cleanup:
IUnknown_SetSite(contextMenu, NULL); IUnknown_SetSite(contextMenu, NULL);
if (treeMenu) if (treeMenu)
DestroyMenu(treeMenu); DestroyMenu(treeMenu);
bNavigating = TRUE; m_bNavigating = TRUE;
TreeView_SelectItem(m_hWnd, oldSelected); TreeView_SelectItem(m_hWnd, m_oldSelected);
bNavigating = FALSE; m_bNavigating = FALSE;
return TRUE; return TRUE;
} }
@ -479,13 +484,13 @@ LRESULT CExplorerBand::ContextMenuHack(UINT uMsg, WPARAM wParam, LPARAM lParam,
info.hItem = NULL; info.hItem = NULL;
// Save the current location // Save the current location
oldSelected = TreeView_GetSelection(m_hWnd); m_oldSelected = TreeView_GetSelection(m_hWnd);
// Move to the item selected by the treeview (don't change right pane) // Move to the item selected by the treeview (don't change right pane)
TreeView_HitTest(m_hWnd, &info); TreeView_HitTest(m_hWnd, &info);
bNavigating = TRUE; m_bNavigating = TRUE;
TreeView_SelectItem(m_hWnd, info.hItem); TreeView_SelectItem(m_hWnd, info.hItem);
bNavigating = FALSE; m_bNavigating = FALSE;
} }
return FALSE; /* let the wndproc process the message */ return FALSE; /* let the wndproc process the message */
} }
@ -534,15 +539,15 @@ LRESULT CExplorerBand::OnShellEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOO
LRESULT CExplorerBand::OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) LRESULT CExplorerBand::OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
{ {
bFocused = TRUE; m_bFocused = TRUE;
IUnknown_OnFocusChangeIS(pSite, reinterpret_cast<IUnknown*>(this), TRUE); IUnknown_OnFocusChangeIS(m_pSite, reinterpret_cast<IUnknown*>(this), TRUE);
bHandled = FALSE; bHandled = FALSE;
return TRUE; return TRUE;
} }
LRESULT CExplorerBand::OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) LRESULT CExplorerBand::OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
{ {
IUnknown_OnFocusChangeIS(pSite, reinterpret_cast<IUnknown*>(this), FALSE); IUnknown_OnFocusChangeIS(m_pSite, reinterpret_cast<IUnknown*>(this), FALSE);
bHandled = FALSE; bHandled = FALSE;
return TRUE; return TRUE;
} }
@ -651,15 +656,15 @@ BOOL CExplorerBand::InsertSubitems(HTREEITEM hItem, NodeInfo *pNodeInfo)
return FALSE; return FALSE;
} }
if (!pDesktop->CompareIDs(NULL, pidlSub, entry)) if (!m_pDesktop->CompareIDs(NULL, pidlSub, entry))
{ {
// We are the desktop, so use pDesktop as pFolder // We are the desktop, so use pDesktop as pFolder
pFolder = pDesktop; pFolder = m_pDesktop;
} }
else else
{ {
// Get an IShellFolder of our pidl // Get an IShellFolder of our pidl
hr = pDesktop->BindToObject(entry, NULL, IID_PPV_ARG(IShellFolder, &pFolder)); hr = m_pDesktop->BindToObject(entry, NULL, IID_PPV_ARG(IShellFolder, &pFolder));
if (!SUCCEEDED(hr)) if (!SUCCEEDED(hr))
{ {
ILFree(pidlSub); ILFree(pidlSub);
@ -730,7 +735,7 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp
return FALSE; return FALSE;
found = FALSE; found = FALSE;
current = hRoot; current = m_hRoot;
parent = NULL; parent = NULL;
while(!found) while(!found)
{ {
@ -742,7 +747,7 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp
return FALSE; return FALSE;
} }
// If we found our node, give it back // If we found our node, give it back
if (!pDesktop->CompareIDs(0, nodeData->absolutePidl, dest)) if (!m_pDesktop->CompareIDs(0, nodeData->absolutePidl, dest))
{ {
if (bSelect) if (bSelect)
TreeView_SelectItem(m_hWnd, current); TreeView_SelectItem(m_hWnd, current);
@ -818,7 +823,7 @@ BOOL CExplorerBand::NavigateToCurrentFolder()
BOOL result; BOOL result;
explorerPidl = NULL; explorerPidl = NULL;
hr = IUnknown_QueryService(pSite, SID_STopLevelBrowser, IID_PPV_ARG(IBrowserService, &pBrowserService)); hr = IUnknown_QueryService(m_pSite, SID_STopLevelBrowser, IID_PPV_ARG(IBrowserService, &pBrowserService));
if (!SUCCEEDED(hr)) if (!SUCCEEDED(hr))
{ {
ERR("Can't get IBrowserService !\n"); ERR("Can't get IBrowserService !\n");
@ -831,10 +836,10 @@ BOOL CExplorerBand::NavigateToCurrentFolder()
ERR("Unable to get browser PIDL !\n"); ERR("Unable to get browser PIDL !\n");
return FALSE; return FALSE;
} }
bNavigating = TRUE; m_bNavigating = TRUE;
/* find PIDL into our explorer */ /* find PIDL into our explorer */
result = NavigateToPIDL(explorerPidl, &dummy, TRUE, FALSE, TRUE); result = NavigateToPIDL(explorerPidl, &dummy, TRUE, FALSE, TRUE);
bNavigating = FALSE; m_bNavigating = FALSE;
return result; return result;
} }
@ -851,7 +856,7 @@ BOOL CExplorerBand::DeleteItem(LPITEMIDLIST idl)
parentNode = TreeView_GetParent(m_hWnd, toDelete); parentNode = TreeView_GetParent(m_hWnd, toDelete);
// Navigate to parent when deleting child item // Navigate to parent when deleting child item
if (!pDesktop->CompareIDs(0, idl, pidlCurrent)) if (!m_pDesktop->CompareIDs(0, idl, m_pidlCurrent))
{ {
TreeView_SelectItem(m_hWnd, parentNode); TreeView_SelectItem(m_hWnd, parentNode);
} }
@ -1009,7 +1014,7 @@ int CALLBACK CExplorerBand::CompareTreeItems(LPARAM p1, LPARAM p2, LPARAM p3)
if (_ILIsSpecialFolder(info1->relativePidl) && !_ILIsSpecialFolder(info2->relativePidl)) if (_ILIsSpecialFolder(info1->relativePidl) && !_ILIsSpecialFolder(info2->relativePidl))
{ {
HRESULT hr; HRESULT hr;
hr = pThis->pDesktop->CompareIDs(0, info1->absolutePidl, info2->absolutePidl); hr = pThis->m_pDesktop->CompareIDs(0, info1->absolutePidl, info2->absolutePidl);
if (!hr) return 0; if (!hr) return 0;
return (hr > 0) ? -1 : 1; return (hr > 0) ? -1 : 1;
} }
@ -1048,7 +1053,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::ResizeBorderDW(const RECT *prcBorder, I
HRESULT STDMETHODCALLTYPE CExplorerBand::ShowDW(BOOL fShow) HRESULT STDMETHODCALLTYPE CExplorerBand::ShowDW(BOOL fShow)
{ {
fVisible = fShow; m_fVisible = fShow;
ShowWindow(fShow); ShowWindow(fShow);
return S_OK; return S_OK;
} }
@ -1061,7 +1066,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::GetBandInfo(DWORD dwBandID, DWORD dwVie
{ {
return E_INVALIDARG; return E_INVALIDARG;
} }
this->dwBandID = dwBandID; this->m_dwBandID = dwBandID;
if (pdbi->dwMask & DBIM_MINSIZE) if (pdbi->dwMask & DBIM_MINSIZE)
{ {
@ -1110,7 +1115,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::SetSite(IUnknown *pUnkSite)
HRESULT hr; HRESULT hr;
HWND parentWnd; HWND parentWnd;
if (pUnkSite == pSite) if (pUnkSite == m_pSite)
return S_OK; return S_OK;
TRACE("SetSite called \n"); TRACE("SetSite called \n");
@ -1121,9 +1126,9 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::SetSite(IUnknown *pUnkSite)
m_hWnd = NULL; m_hWnd = NULL;
} }
if (pUnkSite != pSite) if (pUnkSite != m_pSite)
{ {
pSite = NULL; m_pSite = NULL;
} }
if(!pUnkSite) if(!pUnkSite)
@ -1136,7 +1141,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::SetSite(IUnknown *pUnkSite)
return E_INVALIDARG; return E_INVALIDARG;
} }
pSite = pUnkSite; m_pSite = pUnkSite;
if (m_hWnd) if (m_hWnd)
{ {
@ -1163,7 +1168,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::GetSite(REFIID riid, void **ppvSite)
{ {
if (!ppvSite) if (!ppvSite)
return E_POINTER; return E_POINTER;
*ppvSite = pSite; *ppvSite = m_pSite;
return S_OK; return S_OK;
} }
@ -1186,7 +1191,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::Exec(const GUID *pguidCmdGroup, DWORD n
HRESULT STDMETHODCALLTYPE CExplorerBand::QueryService(REFGUID guidService, REFIID riid, void **ppvObject) HRESULT STDMETHODCALLTYPE CExplorerBand::QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
{ {
/* FIXME: we probably want to handle more services here */ /* FIXME: we probably want to handle more services here */
return IUnknown_QueryService(pSite, SID_SShellBrowser, riid, ppvObject); return IUnknown_QueryService(m_pSite, SID_SShellBrowser, riid, ppvObject);
} }
@ -1209,7 +1214,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::UIActivateIO(BOOL fActivate, LPMSG lpMs
HRESULT STDMETHODCALLTYPE CExplorerBand::HasFocusIO() HRESULT STDMETHODCALLTYPE CExplorerBand::HasFocusIO()
{ {
return bFocused ? S_OK : S_FALSE; return m_bFocused ? S_OK : S_FALSE;
} }
HRESULT STDMETHODCALLTYPE CExplorerBand::TranslateAcceleratorIO(LPMSG lpMsg) HRESULT STDMETHODCALLTYPE CExplorerBand::TranslateAcceleratorIO(LPMSG lpMsg)
@ -1446,8 +1451,8 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::Invoke(DISPID dispIdMember, REFIID riid
HRESULT STDMETHODCALLTYPE CExplorerBand::DragEnter(IDataObject *pObj, DWORD glfKeyState, POINTL pt, DWORD *pdwEffect) HRESULT STDMETHODCALLTYPE CExplorerBand::DragEnter(IDataObject *pObj, DWORD glfKeyState, POINTL pt, DWORD *pdwEffect)
{ {
ERR("Entering drag\n"); ERR("Entering drag\n");
pCurObject = pObj; m_pCurObject = pObj;
oldSelected = TreeView_GetSelection(m_hWnd); m_oldSelected = TreeView_GetSelection(m_hWnd);
return DragOver(glfKeyState, pt, pdwEffect); return DragOver(glfKeyState, pt, pdwEffect);
} }
@ -1470,15 +1475,15 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::DragOver(DWORD glfKeyState, POINTL pt,
if (info.hItem) if (info.hItem)
{ {
bNavigating = TRUE; m_bNavigating = TRUE;
TreeView_SelectItem(m_hWnd, info.hItem); TreeView_SelectItem(m_hWnd, info.hItem);
bNavigating = FALSE; m_bNavigating = FALSE;
// Delegate to shell folder // Delegate to shell folder
if (pDropTarget && info.hItem != childTargetNode) if (m_pDropTarget && info.hItem != m_childTargetNode)
{ {
pDropTarget = NULL; m_pDropTarget = NULL;
} }
if (info.hItem != childTargetNode) if (info.hItem != m_childTargetNode)
{ {
nodeInfo = GetNodeInfo(info.hItem); nodeInfo = GetNodeInfo(info.hItem);
if (!nodeInfo) if (!nodeInfo)
@ -1492,10 +1497,10 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::DragOver(DWORD glfKeyState, POINTL pt,
return E_FAIL; return E_FAIL;
#endif #endif
if(_ILIsDesktop(nodeInfo->absolutePidl)) if(_ILIsDesktop(nodeInfo->absolutePidl))
pShellFldr = pDesktop; pShellFldr = m_pDesktop;
else else
{ {
hr = pDesktop->BindToObject(nodeInfo->absolutePidl, 0, IID_PPV_ARG(IShellFolder, &pShellFldr)); hr = m_pDesktop->BindToObject(nodeInfo->absolutePidl, 0, IID_PPV_ARG(IShellFolder, &pShellFldr));
if (!SUCCEEDED(hr)) if (!SUCCEEDED(hr))
{ {
/* Don't allow dnd since we couldn't get our folder object */ /* Don't allow dnd since we couldn't get our folder object */
@ -1504,7 +1509,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::DragOver(DWORD glfKeyState, POINTL pt,
return E_FAIL; return E_FAIL;
} }
} }
hr = pShellFldr->CreateViewObject(m_hWnd, IID_PPV_ARG(IDropTarget, &pDropTarget)); hr = pShellFldr->CreateViewObject(m_hWnd, IID_PPV_ARG(IDropTarget, &m_pDropTarget));
if (!SUCCEEDED(hr)) if (!SUCCEEDED(hr))
{ {
/* Don't allow dnd since we couldn't get our drop target */ /* Don't allow dnd since we couldn't get our drop target */
@ -1512,18 +1517,18 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::DragOver(DWORD glfKeyState, POINTL pt,
*pdwEffect = DROPEFFECT_NONE; *pdwEffect = DROPEFFECT_NONE;
return E_FAIL; return E_FAIL;
} }
hr = pDropTarget->DragEnter(pCurObject, glfKeyState, pt, pdwEffect); hr = m_pDropTarget->DragEnter(m_pCurObject, glfKeyState, pt, pdwEffect);
childTargetNode = info.hItem; m_childTargetNode = info.hItem;
} }
if (pDropTarget) if (m_pDropTarget)
{ {
hr = pDropTarget->DragOver(glfKeyState, pt, pdwEffect); hr = m_pDropTarget->DragOver(glfKeyState, pt, pdwEffect);
} }
} }
else else
{ {
childTargetNode = NULL; m_childTargetNode = NULL;
pDropTarget = NULL; m_pDropTarget = NULL;
*pdwEffect = DROPEFFECT_NONE; *pdwEffect = DROPEFFECT_NONE;
} }
return S_OK; return S_OK;
@ -1531,22 +1536,22 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::DragOver(DWORD glfKeyState, POINTL pt,
HRESULT STDMETHODCALLTYPE CExplorerBand::DragLeave() HRESULT STDMETHODCALLTYPE CExplorerBand::DragLeave()
{ {
bNavigating = TRUE; m_bNavigating = TRUE;
TreeView_SelectItem(m_hWnd, oldSelected); TreeView_SelectItem(m_hWnd, m_oldSelected);
bNavigating = FALSE; m_bNavigating = FALSE;
childTargetNode = NULL; m_childTargetNode = NULL;
if (pCurObject) if (m_pCurObject)
{ {
pCurObject = NULL; m_pCurObject = NULL;
} }
return S_OK; return S_OK;
} }
HRESULT STDMETHODCALLTYPE CExplorerBand::Drop(IDataObject *pObj, DWORD glfKeyState, POINTL pt, DWORD *pdwEffect) HRESULT STDMETHODCALLTYPE CExplorerBand::Drop(IDataObject *pObj, DWORD glfKeyState, POINTL pt, DWORD *pdwEffect)
{ {
if (!pDropTarget) if (!m_pDropTarget)
return E_FAIL; return E_FAIL;
pDropTarget->Drop(pObj, glfKeyState, pt, pdwEffect); m_pDropTarget->Drop(pObj, glfKeyState, pt, pdwEffect);
DragLeave(); DragLeave();
return S_OK; return S_OK;
} }

View file

@ -2,6 +2,7 @@
* ReactOS Explorer * ReactOS Explorer
* *
* Copyright 2016 Sylvain Deverre <deverre dot sylv at gmail dot com> * Copyright 2016 Sylvain Deverre <deverre dot sylv at gmail dot com>
* Copyright 2020 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -51,27 +52,27 @@ private:
}; };
// *** BaseBarSite information *** // *** BaseBarSite information ***
CComPtr<IUnknown> pSite; CComPtr<IUnknown> m_pSite;
CComPtr<IShellFolder> pDesktop; CComPtr<IShellFolder> m_pDesktop;
// *** tree explorer band stuff *** // *** tree explorer band stuff ***
BOOL fVisible; BOOL m_fVisible;
BOOL bNavigating; BOOL m_bNavigating;
BOOL bFocused; BOOL m_bFocused;
DWORD dwBandID; DWORD m_dwBandID;
HIMAGELIST hImageList; HIMAGELIST m_hImageList;
HTREEITEM hRoot; HTREEITEM m_hRoot;
HTREEITEM oldSelected; HTREEITEM m_oldSelected;
LPITEMIDLIST pidlCurrent; LPITEMIDLIST m_pidlCurrent;
// *** notification cookies *** // *** notification cookies ***
DWORD adviseCookie; DWORD m_adviseCookie;
ULONG shellRegID; ULONG m_shellRegID;
// *** Drop target information *** // *** Drop target information ***
CComPtr<IDropTarget> pDropTarget; CComPtr<IDropTarget> m_pDropTarget;
HTREEITEM childTargetNode; HTREEITEM m_childTargetNode;
CComPtr<IDataObject> pCurObject; CComPtr<IDataObject> m_pCurObject;
void InitializeExplorerBand(); void InitializeExplorerBand();
void DestroyExplorerBand(); void DestroyExplorerBand();