diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index 03a639a902..2e46e3b99b 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -1398,10 +1398,10 @@ HRESULT CDefView::InvokeContextMenuCommand(UINT uCommand) cmi.lpVerb = MAKEINTRESOURCEA(uCommand); cmi.hwnd = m_hWnd; - if (GetKeyState(VK_SHIFT) & 0x8000) + if (GetAsyncKeyState(VK_SHIFT) < 0) cmi.fMask |= CMIC_MASK_SHIFT_DOWN; - if (GetKeyState(VK_CONTROL) & 0x8000) + if (GetAsyncKeyState(VK_CONTROL) < 0) cmi.fMask |= CMIC_MASK_CONTROL_DOWN; HRESULT hr = m_pCM->InvokeCommand(&cmi); @@ -3574,6 +3574,11 @@ HRESULT WINAPI CDefView::Drop(IDataObject* pDataObject, DWORD grfKeyState, POINT ImageList_DragLeave(m_hWnd); ImageList_EndDrag(); + if (GetAsyncKeyState(VK_SHIFT) < 0) + grfKeyState |= MK_SHIFT; + else + grfKeyState &= ~MK_SHIFT; + if ((IsDropOnSource(NULL) == S_OK) && (*pdwEffect & DROPEFFECT_MOVE) && (m_grfKeyState & MK_LBUTTON)) diff --git a/dll/win32/shell32/CDefaultContextMenu.cpp b/dll/win32/shell32/CDefaultContextMenu.cpp index dde9887339..541915e0f3 100644 --- a/dll/win32/shell32/CDefaultContextMenu.cpp +++ b/dll/win32/shell32/CDefaultContextMenu.cpp @@ -833,7 +833,8 @@ HRESULT CDefaultContextMenu::DoDelete(LPCMINVOKECOMMANDINFO lpcmi) if (FAILED_UNEXPECTEDLY(hr)) return hr; - SHSimulateDrop(pDT, m_pDataObj, 0, NULL, NULL); + DWORD grfKeyState = (lpcmi->fMask & CMIC_MASK_SHIFT_DOWN) ? MK_SHIFT : 0; + SHSimulateDrop(pDT, m_pDataObj, grfKeyState, NULL, NULL); return S_OK; } diff --git a/dll/win32/shell32/droptargets/CRecyclerDropTarget.cpp b/dll/win32/shell32/droptargets/CRecyclerDropTarget.cpp index efd446d5cf..0be93642b7 100644 --- a/dll/win32/shell32/droptargets/CRecyclerDropTarget.cpp +++ b/dll/win32/shell32/droptargets/CRecyclerDropTarget.cpp @@ -140,12 +140,10 @@ class CRecyclerDropTarget : } HRESULT WINAPI Drop(IDataObject *pDataObject, - DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) + DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) { TRACE("(%p) object dropped on recycle bin, effect %u\n", this, *pdwEffect); - /* TODO: pdwEffect should be read and make the drop object be permanently deleted in the move case (shift held) */ - FORMATETC fmt; TRACE("(%p)->(DataObject=%p)\n", this, pDataObject); InitFormatEtc (fmt, cfShellIDList, TYMED_HGLOBAL); @@ -155,7 +153,7 @@ class CRecyclerDropTarget : { DWORD fMask = 0; - if ((dwKeyState & MK_SHIFT) == MK_SHIFT) + if ((grfKeyState & MK_SHIFT) == MK_SHIFT) fMask |= CMIC_MASK_SHIFT_DOWN; _DoDeleteAsync(pDataObject, fMask);