From: Giannis Adamopoulos Date: Sat, 23 Jul 2016 08:42:38 +0000 (+0000) Subject: [SHELL32] X-Git-Tag: ReactOS-0.4.2~44 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=73e04c0cd1e89fde60c4cba07c1f5b47fb3c7dc6;hp=e88de7514506d98cb92be7a4988cf5d04e855099;ds=sidebyside [SHELL32] - CDefView: Add the skeleton check that should be used to implement moving items in the CDefView. Nothing more is implemented because GetKeyState is completely unreliable. svn path=/trunk/; revision=71979 --- diff --git a/reactos/dll/win32/shell32/CDefView.cpp b/reactos/dll/win32/shell32/CDefView.cpp index 86f73b488f2..6e4c47c2722 100644 --- a/reactos/dll/win32/shell32/CDefView.cpp +++ b/reactos/dll/win32/shell32/CDefView.cpp @@ -97,6 +97,7 @@ class CDefView : DWORD m_dwAdvf; CComPtr m_pAdvSink; // for drag and drop + CComPtr m_pSourceDataObject; CComPtr m_pCurDropTarget; /* The sub-item, which is currently dragged over */ CComPtr m_pCurDataObject; /* The dragged data-object */ LONG m_iDragOverItem; /* Dragged over item's index, iff m_pCurDropTarget != NULL */ @@ -1786,7 +1787,12 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl } DWORD dwEffect2; + + m_pSourceDataObject = pda; + DoDragDrop(pda, this, dwEffect, &dwEffect2); + + m_pSourceDataObject.Release(); } } break; @@ -2937,7 +2943,23 @@ HRESULT WINAPI CDefView::DragLeave() HRESULT WINAPI CDefView::Drop(IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) { - if (m_pCurDropTarget) + ERR("GetKeyState(VK_LBUTTON): %d\n", GetKeyState(VK_LBUTTON)); + + if ((m_iDragOverItem == -1) && + (*pdwEffect & DROPEFFECT_MOVE) && + (GetKeyState(VK_LBUTTON) != 0) && + (m_pSourceDataObject.p) && + (SHIsSameObject(pDataObject, m_pSourceDataObject))) + { + ERR("Should implement moving items here!\n"); + + if (m_pCurDropTarget) + { + m_pCurDropTarget->DragLeave(); + m_pCurDropTarget.Release(); + } + } + else if (m_pCurDropTarget) { m_pCurDropTarget->Drop(pDataObject, grfKeyState, pt, pdwEffect); m_pCurDropTarget.Release();