createEvent method
Creates a Document Object Model (DOM) event of the specified type.
![]() ![]() |
Syntax
HRESULT retVal = object.createEvent(eventType, ppEvent);
Parameters
- eventType [in]
-
Type: BSTR
One of the following values. Case is not important.
-
Creates a Event object.
-
Same as Event.
-
Creates a CompositionEvent object.
-
Creates a CustomEvent object.
-
Creates a DragEvent object.
-
Creates a FocusEvent object.
-
Creates a KeyboardEvent object.
-
Creates a MessageEvent object.
-
Creates a MouseEvent object.
-
Same as MouseEvent.
-
Creates a MouseWheelEvent object.
-
Creates a MutationEvent object.
-
Same as MutationEvent.
-
Creates a StorageEvent object.
-
Creates a TextEvent object.
-
Creates a UIEvent object
-
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 code | Description |
|---|---|
|
The operation completed successfully. |
Standards information
- The canvas element, Section 1.5
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

