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.