Click to return to the Reusing Browser Technology home page    
IHTMLDocument3::get_oncel...     IHTMLDocument3::get_ondat...     IHTMLDocument3 Interface    
Web Workshop  |  Reusing Browser Technology

IHTMLDocument3::get_oncontextmenu Method


Retrieves a pointer to the event handler function associated with the element's oncontextmenu event.

Syntax

HRESULT get_oncontextmenu(
    VARIANT *p
);

Parameters

p
Address of a VARIANT structure that contains the script.

Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

Use the following code fragment to obtain an event handler.
pBody->get_onEvent( &_variant_t(pDisp) ); 
// pDisp a pointer to an IDispatch interface
// pBody a pointer to an element of interest


IHTMLDocument3::put_oncontextmenu Method


Sets a pointer to the event handler function associated with the element's oncontextmenu event.

Syntax

HRESULT put_oncontextmenu(
    VARIANT v
);

Parameters

v
VARIANT structure that contains the script to set.

Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

Use the following code fragment to set an event handler. This method will only add a single event handler. To add multiple event handlers, see the IHTMLDocument3::attachEvent, IHTMLElement2::attachEvent, and IHTMLWindow3::attachEvent methods.

pBody->put_onEvent( &_variant_t(pDisp) ); 
// pDisp a pointer to an IDispatch interface
// pBody a pointer to an element of interest


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.