-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWinListDropSource.cpp
More file actions
55 lines (48 loc) · 945 Bytes
/
Copy pathWinListDropSource.cpp
File metadata and controls
55 lines (48 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <windows.h>
#include "WinListDropSource.h"
WinListDropSource::WinListDropSource()
{
reference_count = 1;
}
WinListDropSource::~WinListDropSource()
{
}
STDMETHODIMP WinListDropSource::QueryInterface(REFIID id,void **obj)
{
*obj = NULL;
if(IsEqualIID(id,IID_IUnknown) || IsEqualIID(id,IID_IDropSource))
{
*obj = (void*)this;
return S_OK;
}
return E_NOINTERFACE;
}
STDMETHODIMP_(ULONG) WinListDropSource::AddRef()
{
return ++reference_count;
}
STDMETHODIMP_(ULONG) WinListDropSource::Release()
{
if(!--reference_count)
{
delete this;
return 0;
}
return reference_count;
}
STDMETHODIMP WinListDropSource::QueryContinueDrag(BOOL escape,DWORD key_state)
{
if(escape)
{
return DRAGDROP_S_CANCEL;
}
if(!(key_state & MK_LBUTTON))
{
return DRAGDROP_S_DROP;
}
return S_OK;
}
STDMETHODIMP WinListDropSource::GiveFeedBack(DWORD effect)
{
return S_OK;
}