Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

createEvent method

Creates a Document Object Model (DOM) event of the specified type.

The canvas element, Section 1.5Internet Explorer 9

Syntax


HRESULT retVal = object.createEvent(eventType, ppEvent);

Parameters

eventType [in]

Type: BSTR

One of the following values. Case is not important.

Event

Creates a Event object.

Events

Same as Event.

CompositionEvent

Creates a CompositionEvent object.

CustomEvent

Creates a CustomEvent object.

DragEvent

Creates a DragEvent object.

FocusEvent

Creates a FocusEvent object.

KeyboardEvent

Creates a KeyboardEvent object.

MessageEvents

Creates a MessageEvent object.

MouseEvent

Creates a MouseEvent object.

MouseEvents

Same as MouseEvent.

MouseWheelEvent

Creates a MouseWheelEvent object.

MutationEvent

Creates a MutationEvent object.

MutationEvents

Same as MutationEvent.

StorageEvent

Creates a StorageEvent object.

TextEvent

Creates a TextEvent object.

UIEvent

Creates a UIEvent object

UIEvents

Same as UIEvent.

ppEvent [out, retval]

Type: IDOMEvent

The address of a pointer to IDOMEvent that receives the event object.

Return value

Type: HRESULT

This method can return one of these values.

Return codeDescription
S_OK

The operation completed successfully.

 

Standards information

Remarks

If the event object is to be dispatched with IEventTarget::dispatchEvent, the appropriate event initialization method must be called. For example, after creating an event of type UIEvent, call IDOMUIEvent::initUIEvent to initialize the event object's values.

Security Warning:  For security reasons, events generated with IDocumentEvent::createEvent are untrusted and have a IDOMEvent::isTrusted value of VARIANT_FALSE.

See also

Reference
IDOMCompositionEvent::initCompositionEvent
IDOMCustomEvent::initCustomEvent
IDOMDragEvent::initDragEvent
IDOMEvent::initEvent
IDOMFocusEvent::initFocusEvent
IDOMKeyboardEvent::initKeyboardEvent
IDOMMessageEvent::initMessageEvent
IDOMMouseEvent::initMouseEvent
IDOMMouseWheelEvent::initMouseWheelEvent
IDOMMutationEvent::initMutationEvent
IDOMStorageEvent::initStorageEvent
IDOMTextEvent::initTextEvent
IDOMUIEvent::initUIEvent
IDOMWheelEvent::initWheelEvent

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.