mirror of
https://github.com/reactos/reactos.git
synced 2025-05-22 10:35:54 +00:00
[SHELL32] -CDefView: Calculate correctly the position of the cursor over the icon. Call ImageList_DragEnter only after we are sure that DragEnter will succeed.
svn path=/trunk/; revision=73664
This commit is contained in:
parent
b12e316394
commit
cf28e96ee8
1 changed files with 10 additions and 6 deletions
|
@ -1769,7 +1769,7 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl
|
|||
POINT ptItem;
|
||||
m_ListView.GetItemPosition(params->iItem, &ptItem);
|
||||
|
||||
ImageList_BeginDrag(big_icons, iIcon, m_ptFirstMousePos.x - ptItem.x, m_ptFirstMousePos.y - ptItem.y);
|
||||
ImageList_BeginDrag(big_icons, iIcon, params->ptAction.x - ptItem.x, params->ptAction.y - ptItem.y);
|
||||
|
||||
DoDragDrop(pda, this, dwEffect, &dwEffect2);
|
||||
|
||||
|
@ -2940,14 +2940,18 @@ HRESULT CDefView::drag_notify_subitem(DWORD grfKeyState, POINTL pt, DWORD *pdwEf
|
|||
|
||||
HRESULT WINAPI CDefView::DragEnter(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
|
||||
{
|
||||
POINT ptClient = {pt.x, pt.y};
|
||||
ScreenToClient(&ptClient);
|
||||
|
||||
/* Get a hold on the data object for later calls to DragEnter on the sub-folders */
|
||||
m_pCurDataObject = pDataObject;
|
||||
|
||||
ImageList_DragEnter(m_hWnd, ptClient.x, ptClient.y);
|
||||
return drag_notify_subitem(grfKeyState, pt, pdwEffect);
|
||||
HRESULT hr = drag_notify_subitem(grfKeyState, pt, pdwEffect);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
POINT ptClient = {pt.x, pt.y};
|
||||
ScreenToClient(&ptClient);
|
||||
ImageList_DragEnter(m_hWnd, ptClient.x, ptClient.y);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CDefView::DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
|
||||
|
|
Loading…
Reference in a new issue