You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For API reviewers, We want a unified API surface between COM and WinRT that works in both UWP and Win32.
26
23
27
24
We could:
@@ -34,17 +31,20 @@ Because the conversion is simple and we have a large Win32 user base we chose (1
34
31
35
32
# Description
36
33
DragEnter, DragOver, DragLeave, and Drop are functions meant to provide a way for composition hosted WebViews to receive drop events as part of a drag/drop operation.
37
-
It is the hosting application's responsibility to call RegisterDragDrop(https://docs.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-registerdragdrop)
38
-
on the HWND that contains any composition hosted WebViews and to implement IDropTarget(https://docs.microsoft.com/en-us/windows/win32/api/oleidl/nn-oleidl-idroptarget)
34
+
For win32, it is the hosting application's responsibility to call [RegisterDragDrop](https://docs.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-registerdragdrop)
35
+
on the HWND that contains any composition hosted WebViews and to implement [IDropTarget](https://docs.microsoft.com/en-us/windows/win32/api/oleidl/nn-oleidl-idroptarget)
39
36
to receive the corresponding drop events from Ole32:
40
37
41
38
- IDropTarget::DragEnter
42
39
- IDropTarget::DragMove
43
40
- IDropTarget::DragLeave
44
41
- IDropTarget::Drop
45
42
46
-
For other UI frameworks such as Xaml, the hosting application would set event handlers for DragEnter, DragOver, DragLeave, and Drop
47
-
on the UIElement that contains the WebView2 element.
43
+
The HWND doesn't have to be the immediate parent of the WebView2 but it does have to convert the POINTL argument in the above functions from screen coordinates to client coordinates of the WebView2.
44
+
45
+
For WinRT, it is the hosting applications responsibility to register as a drop target via [CoreDragDropManager](https://docs.microsoft.com/en-us/uwp/api/windows.applicationmodel.datatransfer.dragdrop.core.coredragdropmanager)
46
+
on CoreDragDropManager.TargetRequested and to call [CoreDropOperationTargetRequestedEventArgs.SetTarget(ICoreDropOperationTarget)](https://docs.microsoft.com/en-us/uwp/api/windows.applicationmodel.datatransfer.dragdrop.core.coredropoperationtargetrequestedeventargs)
47
+
on an implementation of [ICoreDropOperationTarget](https://docs.microsoft.com/en-us/uwp/api/Windows.ApplicationModel.DataTransfer.DragDrop.Core.ICoreDropOperationTarget).
48
48
49
49
# Examples
50
50
## Win32
@@ -54,17 +54,10 @@ on the UIElement that contains the WebView2 element.
0 commit comments