This topic documents a feature of Binary Behaviors, which are obsolete as of Internet Explorer 10.
Notifies the Dynamic HTML (DHTML) behavior that it is being detached from an element.
Returns S_OK if successful, or an error value otherwise.
This method notifies the DHTML behavior when the document unloads; or when the behavior is removed through a call to IHTMLElement2::removeBehavior, or as a result of a Cascading Style Sheets (CSS) change.
This method is called when the master element of an element behavior is removed from the parent document. Windows Internet Explorer calls this method on a behavior when a document is unloaded.
The IElementBehavior::Detach method should not be called from an element behavior, in an attempt to detach the behavior from its master element.
This method is not called if a pointer to the master element that is used by the behavior has been cached.