mirror of
https://github.com/reactos/reactos.git
synced 2025-01-13 01:22:03 +00:00
Mikhail Denisenko <denisenkom@gmail.com>
- RegisterDragDrop should be coupled with a RevokeDragDrop, so add that. - Remove _pDropTarget from class members, it's a var local to DesktopShellView::InitDragDrop() method. See issue #2012 for more details. svn path=/trunk/; revision=41145
This commit is contained in:
parent
b943ea64cf
commit
bc373b83fc
2 changed files with 16 additions and 10 deletions
|
@ -506,24 +506,29 @@ DesktopShellView::DesktopShellView(HWND hwnd, IShellView* pShellView)
|
|||
InitDragDrop();
|
||||
}
|
||||
|
||||
|
||||
DesktopShellView::~DesktopShellView()
|
||||
{
|
||||
if (FAILED(RevokeDragDrop(_hwnd)))
|
||||
assert(0);
|
||||
}
|
||||
|
||||
|
||||
bool DesktopShellView::InitDragDrop()
|
||||
{
|
||||
CONTEXT("DesktopShellView::InitDragDrop()");
|
||||
|
||||
_pDropTarget = new DesktopDropTarget(_hwnd);
|
||||
DesktopDropTarget * pDropTarget = new DesktopDropTarget(_hwnd);
|
||||
|
||||
if (!_pDropTarget)
|
||||
if (!pDropTarget)
|
||||
return false;
|
||||
|
||||
_pDropTarget->AddRef();
|
||||
pDropTarget->AddRef();
|
||||
|
||||
if (FAILED(RegisterDragDrop(_hwnd, _pDropTarget))) {
|
||||
_pDropTarget->Release();
|
||||
_pDropTarget = NULL;
|
||||
if (FAILED(RegisterDragDrop(_hwnd, pDropTarget))) {
|
||||
pDropTarget->Release();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
_pDropTarget->Release();
|
||||
|
||||
FORMATETC ftetc;
|
||||
|
||||
|
@ -532,7 +537,8 @@ bool DesktopShellView::InitDragDrop()
|
|||
ftetc.tymed = TYMED_HGLOBAL;
|
||||
ftetc.cfFormat = CF_HDROP;
|
||||
|
||||
_pDropTarget->AddSuportedFormat(ftetc);
|
||||
pDropTarget->AddSuportedFormat(ftetc);
|
||||
pDropTarget->Release();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -170,6 +170,7 @@ struct DesktopShellView : public ExtContextMenuHandlerT<SubclassedWindow>
|
|||
typedef ExtContextMenuHandlerT<SubclassedWindow> super;
|
||||
|
||||
DesktopShellView(HWND hwnd, IShellView* pShellView);
|
||||
~DesktopShellView();
|
||||
|
||||
bool InitDragDrop();
|
||||
|
||||
|
@ -186,7 +187,6 @@ protected:
|
|||
|
||||
void refresh();
|
||||
|
||||
DesktopDropTarget* _pDropTarget;
|
||||
HWND _hwndListView;
|
||||
int _icon_algo;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue