Share via


RegisterEvent method

Registers a custom Dynamic HTML (DHTML) behavior event.

Syntax

HRESULT retVal = object.RegisterEvent(pchEvent, lFlags, plCookie);

Parameters

pchEvent [in]

Type: LPOLESTR

A pointer to a string that specifies the name of the event to register.

lFlags [in]

Type: LONG

A long value that specifies one of the following flags, or zero.

BEHAVIOREVENTFLAGS_BUBBLE (1)

The event is allowed to bubble.

BEHAVIOREVENTFLAGS_STANDARDADDITIVE (2)

The event is not allowed to bubble.

plCookie [out, retval]

Type: LONG

A pointer to a variable of type LONG that identifies the custom event specified by pchEvent. This value is used by the IElementBehaviorSiteOM::FireEvent method and the IElementBehaviorSiteOM::GetEventCookie method.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

A Dynamic HTML (DHTML) behavior must call this method for MSHTML to recognize the custom event.

Event bubbling is automatically disabled for all but standard events.