Поделиться через


PreHandleEvent method

Called by MSHTML before the MSHTML Editor processes an event, so that the designer can provide its own event handling behavior.

Syntax

HRESULT retVal = object.PreHandleEvent(inEvtDispId, pIEventObj);

Parameters

  • inEvtDispId [in]
    Type: DISPID

    A DISPID that specifies the event.

  • pIEventObj [in]
    Type: IHTMLEventObj

    A pointer to an IHTMLEventObj interface that specifies the event.

Remarks

MSHTML calls this method before it processes an event in the editor's environment. In a custom editor implementation, this method enables you to modify the behavior of an event before the MSHTML Editor processes it.

The DISPID parameter provides the most efficient way for an IHTMLEditDesigner method to determine what type of event triggered the method call. The DISPID_HTMLELEMENTEVENTS2 identifiers are defined in Mshtmdid.h.

Note  IME events do not have DISPIDs, so the DISPID parameter is zero for any IME event. If a designer handles IME events and the DISPID is zero, the designer can determine the event type from the IHTMLEventObj::srcElement property.