@@ -30,12 +30,10 @@ CHECK_FAILURE(m_compController5->add_DragStarting(
3030 [ this] (ICoreWebView2CompositionController5* sender,
3131 ICoreWebView2DragStartingEventArgs* args)
3232 {
33- DWORD allowedEffects = COREWEBVIEW2_DROP_EFFECTS_NONE;
34- POINT dragPosition = {0, 0};
33+ DWORD okEffects = COREWEBVIEW2_DROP_EFFECTS_NONE;
3534 wil::com_ptr<IDataObject > dragData;
3635
37- CHECK_FAILURE(args->get_AllowedDropEffects(&allowedEffects));
38- CHECK_FAILURE(args->get_Position(&dragPosition));
36+ CHECK_FAILURE(args->get_AllowedDropEffects(&okEffects));
3937 CHECK_FAILURE(args->get_Data(&dragData));
4038
4139 // This member refers to an implementation of IDropSource. It is an
@@ -46,9 +44,9 @@ CHECK_FAILURE(m_compController5->add_DragStarting(
4644 m_dropSource = Make<ScenarioDragDropOverrideDropSource>();
4745 }
4846
47+ DWORD effect = DROPEFFECT_NONE;
4948 HRESULT hr = DoDragDrop(
50- dragData.get(), m_dropSource.get(), allowedEffects, &effect);
51-
49+ dragData.get(), m_dropSource.get(), okEffects, &effect);
5250 args->put_Handled(SUCCEEDED(hr));
5351
5452 return hr;
@@ -76,25 +74,16 @@ CHECK_FAILURE(m_compController5->add_DragStarting(
7674
7775# API Details
7876``` 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-
8977// / Event args for the `DragStarting` event.
9078[uuid(edb6b243-334f -59d0-b3b3-de87dd401adc), object, pointer_default(unique)]
9179interface 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.
9382 [ propget] HRESULT AllowedDropEffects(
9483 [ out, retval] COREWEBVIEW2_DROP_EFFECTS* value);
9584
9685
97- /// The data being dragged.
86+ /// The data to be dragged.
9887 [ propget] HRESULT Data([ out, retval] IDataObject** value);
9988
10089 /// The position at which drag was detected given in WebView2 relative
0 commit comments