initDragEvent method

[This documentation is preliminary and is subject to change.]

Initializes a new drag event.

HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 7.9.2Internet Explorer 9

Syntax

HRESULT retVal = object.initDragEvent(eventType, canBubble, cancelable, viewArg, detailArg, screenXArg, screenYArg, clientXArg, clientYArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, buttonArg, relatedTargetArg, dataTransferArg);

Standards information

Parameters

eventType [in]

Type: BSTR

One of the following, or a user-defined custom event type.

drag

This is an ondrag event.

dragend

This is an ondragend event.

dragenter

This is an ondragenter event.

dragleave

This is an ondragleave event.

dragover

This is an ondragover event.

dragstart

This is an ondragstart event.

drop

This is an ondrop event.

canBubble [in]

Type: VARIANT_BOOL

VARIANT_TRUE (true)

The event should propagate upward.

VARIANT_FALSE (false)

The event does not propagate upward.

cancelable [in]

Type: VARIANT_BOOL

VARIANT_TRUE (true)

The default action can be canceled.

VARIANT_FALSE (false)

The default action cannot be canceled.

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 view attribute of the event.

detailArg [in]

Type: long

long that specifies additional information. This value is returned in the 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 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 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 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 clientY attribute of the event.

ctrlKeyArg [in]

Type: VARIANT_BOOL

The value that is returned in the ctrlKey attribute of the event.

VARIANT_TRUE (true)

The left or right CONTROL key was pressed.

VARIANT_FALSE (false)

Neither CONTROL key was pressed.

altKeyArg [in]

Type: VARIANT_BOOL

The value that is returned in the altKey attribute of the event.

VARIANT_TRUE (true)

The left or right ALT key was pressed.

VARIANT_FALSE (false)

Neither ALT key was pressed.

shiftKeyArg [in]

Type: VARIANT_BOOL

The value that is returned in the shiftKey attribute of the event.

VARIANT_TRUE (true)

The left or right SHIFT key was pressed.

VARIANT_FALSE (false)

Neither SHIFT key was pressed.

metaKeyArg [in]

Type: VARIANT_BOOL

The value that is returned in the metaKey attribute of the event.

VARIANT_TRUE (true)

The left or right META/COMMAND key was pressed.

VARIANT_FALSE (false)

Neither META/COMMAND key was pressed.

buttonArg [in]

Type: USHORT

unsigned short that specifies the mouse button that caused the event. This value is returned in the button attribute of the event.

0

No button is pressed.

1

The left button is pressed.

2

The right button is pressed.

relatedTargetArg [in]

Type: IEventTarget

Pointer to an IEventTarget variable that specifies the related element of the mouse event. This value is returned in the 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 dataTransfer attribute of the event.

Return value

Type: HRESULT

This method can return one of these values.

Return code Description
S_OK

The operation completed successfully.

E_INVALIDARG

One or more arguments are invalid.

 

See also

createEvent

 

 

Build date: 1/23/2012