initDragEvent method
Initializes a new drag event.
![]() ![]() |
Syntax
HRESULT retVal = object.initDragEvent(eventType, canBubble, cancelable, viewArg, detailArg, screenXArg, screenYArg, clientXArg, clientYArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, buttonArg, relatedTargetArg, dataTransferArg);
Parameters
- eventType [in]
-
Type: BSTR
One of the following, or a user-defined custom event type.
-
This is an HTMLFrameSiteEvents::ondrag event.
-
This is an HTMLFrameSiteEvents::ondragend event.
-
This is an HTMLFrameSiteEvents::ondragenter event.
-
This is an HTMLFrameSiteEvents::ondragleave event.
-
This is an HTMLFrameSiteEvents::ondragover event.
-
This is an HTMLFrameSiteEvents::ondragstart event.
-
This is an HTMLFrameSiteEvents::ondrop event.
- canBubble [in]
-
Type: VARIANT_BOOL
- cancelable [in]
-
Type: VARIANT_BOOL
- viewArg [in]
-
Type: IHTMLWindow2
Address of a pointer to an IHTMLWindow2 variable that specifies the current window, or NULL. This value is returned in the IDOMUIEvent::view attribute of the event. - detailArg [in]
-
Type: long
long that specifies additional information. This value is returned in the IDOMUIEvent::detail attribute of the event.
- screenXArg [in]
-
Type: long
long that specifies the x-coordinate of the mouse pointer relative to the upper-left corner of the screen. This value is returned in the IDOMMouseEvent::screenX attribute of the event.
- screenYArg [in]
-
Type: long
long that specifies the y-coordinate of the mouse pointer relative to the upper-left corner of the screen. This value is returned in the IDOMMouseEvent::screenY attribute of the event.
- clientXArg [in]
-
Type: long
long that specifies the x-coordinate of the mouse pointer relative to the upper-left corner of the browser's client area. This value is returned in the IDOMMouseEvent::clientX attribute of the event.
- clientYArg [in]
-
Type: long
long that specifies the y-coordinate of the mouse pointer relative to the upper-left corner of the browser's client area. This value is returned in the IDOMMouseEvent::clientY attribute of the event.
- ctrlKeyArg [in]
-
Type: VARIANT_BOOL
The value that is returned in the IDOMKeyboardEvent::ctrlKey attribute of the event.
- altKeyArg [in]
-
Type: VARIANT_BOOL
The value that is returned in the IDOMKeyboardEvent::altKey attribute of the event.
- shiftKeyArg [in]
-
Type: VARIANT_BOOL
The value that is returned in the IDOMKeyboardEvent::shiftKey attribute of the event.
- metaKeyArg [in]
-
Type: VARIANT_BOOL
The value that is returned in the IDOMKeyboardEvent::metaKey attribute of the event.
- buttonArg [in]
-
Type: USHORT
unsigned short that specifies the mouse button that caused the event. This value is returned in the IDOMMouseEvent::button attribute of the event.
- relatedTargetArg [in]
-
Type: IEventTarget
Pointer to an IEventTarget variable that specifies the related element of the mouse event. This value is returned in the IDOMFocusEvent::relatedTarget attribute of the event. - dataTransferArg [in]
-
Type: IHTMLDataTransfer
Pointer to an IHTMLDataTransfer variable that represents the drag-and-drop operation. This value is returned in the IDOMDragEvent::dataTransfer attribute of the event.
Return value
Type: HRESULT
This method can return one of these values.
| Return code | Description |
|---|---|
|
The operation completed successfully. |
|
One or more arguments are invalid. |
Standards information
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 7.9.2
See also

