@@ -30,12 +30,10 @@ CHECK_FAILURE(m_compController5->add_DragStarting(
30
30
[ this] (ICoreWebView2CompositionController5* sender,
31
31
ICoreWebView2DragStartingEventArgs* args)
32
32
{
33
- DWORD allowedEffects = COREWEBVIEW2_DROP_EFFECTS_NONE;
34
- POINT dragPosition = {0, 0};
33
+ DWORD okEffects = COREWEBVIEW2_DROP_EFFECTS_NONE;
35
34
wil::com_ptr<IDataObject > dragData;
36
35
37
- CHECK_FAILURE(args->get_AllowedDropEffects(&allowedEffects));
38
- CHECK_FAILURE(args->get_Position(&dragPosition));
36
+ CHECK_FAILURE(args->get_AllowedDropEffects(&okEffects));
39
37
CHECK_FAILURE(args->get_Data(&dragData));
40
38
41
39
// This member refers to an implementation of IDropSource. It is an
@@ -46,9 +44,9 @@ CHECK_FAILURE(m_compController5->add_DragStarting(
46
44
m_dropSource = Make<ScenarioDragDropOverrideDropSource>();
47
45
}
48
46
47
+ DWORD effect = DROPEFFECT_NONE;
49
48
HRESULT hr = DoDragDrop(
50
- dragData.get(), m_dropSource.get(), allowedEffects, &effect);
51
-
49
+ dragData.get(), m_dropSource.get(), okEffects, &effect);
52
50
args->put_Handled(SUCCEEDED(hr));
53
51
54
52
return hr;
@@ -76,25 +74,16 @@ CHECK_FAILURE(m_compController5->add_DragStarting(
76
74
77
75
# API Details
78
76
``` C++
79
- // / DWORD constants that represent the effects that a given WebView2 drag drop
80
- // / operation can have. The values of this enum align with the
81
- // / [OLE DROPEFFECT constant](https://learn.microsoft.com/en-us/windows/win32/com/dropeffect-constants)
82
- // / with the exception of DROPEFFECT_SCROLL which is unused in WebView2 drag
83
- // / drop scenarios.
84
- const DWORD COREWEBVIEW2_DROP_EFFECTS_NONE = 0 ;
85
- const DWORD COREWEBVIEW2_DROP_EFFECTS_COPY = 1 ;
86
- const DWORD COREWEBVIEW2_DROP_EFFECTS_MOVE = 2 ;
87
- const DWORD COREWEBVIEW2_DROP_EFFECTS_LINK = 4 ;
88
-
89
77
// / Event args for the `DragStarting` event.
90
78
[uuid(edb6b243-334f -59d0-b3b3-de87dd401adc), object, pointer_default(unique)]
91
79
interface ICoreWebView2DragStartingEventArgs : IUnknown {
92
- /// The operations this drag data supports.
80
+ /// The [ OLE DROPEFFECT] ( https://learn.microsoft.com/en-us/windows/win32/com/dropeffect-constants )
81
+ /// values this drag data supports.
93
82
[ propget] HRESULT AllowedDropEffects(
94
83
[ out, retval] COREWEBVIEW2_DROP_EFFECTS* value);
95
84
96
85
97
- /// The data being dragged.
86
+ /// The data to be dragged.
98
87
[ propget] HRESULT Data([ out, retval] IDataObject** value);
99
88
100
89
/// The position at which drag was detected given in WebView2 relative
0 commit comments