다음을 통해 공유


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.

drag

This is an HTMLFrameSiteEvents::ondrag event.

dragend

This is an HTMLFrameSiteEvents::ondragend event.

dragenter

This is an HTMLFrameSiteEvents::ondragenter event.

dragleave

This is an HTMLFrameSiteEvents::ondragleave event.

dragover

This is an HTMLFrameSiteEvents::ondragover event.

dragstart

This is an HTMLFrameSiteEvents::ondragstart event.

drop

This is an HTMLFrameSiteEvents::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 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.

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 IDOMKeyboardEvent::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 IDOMKeyboardEvent::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 IDOMKeyboardEvent::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 IDOMMouseEvent::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 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
S_OK

The operation completed successfully.

E_INVALIDARG

One or more arguments are invalid.

 

Standards information

See also

IDocumentEvent::createEvent