initFocusEvent method
Initializes a new focus event that the IDocumentEvent::createEvent method created.
![]() ![]() |
Syntax
HRESULT retVal = object.initFocusEvent(eventType, canBubble, cancelable, viewArg, detailArg, relatedTargetArg );
Parameters
- eventType [in]
-
Type: BSTR
One of the following values, or a user-defined custom event type.
-
This event is an HTMLFrameSiteEvents::onblur event.
-
This event is an HTMLFrameSiteEvents::onfocus event.
-
This event is an HTMLFrameSiteEvents::onfocusin event.
-
This event is an HTMLFrameSiteEvents::onfocusout event.
- canBubble [in]
-
Type: VARIANT_BOOL
- cancelable [in]
-
Type: VARIANT_BOOL
- viewArg [in]
-
Type: IHTMLWindow2
An IHTMLWindow2 variable that specifies the active window, or NULL. This value is returned in the IDOMUIEvent::view property of the event. - detailArg [in]
-
Type: long
A long value that specifies additional information. This value is returned in the IDOMUIEvent::detail property of the event.
- relatedTargetArg
-
Type: IEventTarget
The object used for the IDOMFocusEvent::relatedTarget attribute of the new focus event.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
- Document Object Model (DOM) Level 3 Events Specification, Section 5.2.2
See also

