CWebView::DisableEvents Method  
 
BOOL DisableEvents();

The DisableEvents method disables event handling for the browser.

Parameters

None.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

This method removes the currently installed event handler for the browser and clears the user parameter. After it returns, the application will not receive any further browser events until EnableEvents is called again with a valid handler. Use this to permanently stop participating in event notifications (for example, during shutdown or when detaching the browser control from the host). Unlike temporarily freezing events, this method completely clears the callback handler for the browser instance.

If you only need to pause notifications temporarily, such as when presenting a modal dialog, performing a batch of UI updates, or executing several programmatic navigations back-to-back, freezing events is the recommended approach. Disabling events should be reserved for longer-term or terminal states, typically when the application is in the process of closing down.

You should not call DisableEvents from inside an event handler. Disabling callbacks while you are actively processing an event can lead to subtle reentrancy issues and missed cleanup. If you need to suspend notifications from within an event, call FreezeEvents instead, complete your work, and then unfreeze when you are ready to resume event handling.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: cshtmv12.lib

See Also