Shield webbrowser right

zhaozj2021-02-16  123

Public Delegate Void DHTMLEVENT (IHTMLVENTOBJ E);

public class DHTMLEventHandler {public DHTMLEvent Handler; HTMLDocument Document; public DHTMLEventHandler (HTMLDocument doc) {this.Document = doc;} public void Call () {Handler (Document.parentWindow @ event.);}}

private void axWebBrowser1_DocumentComplete (object sender, AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e) {HTMLDocument doc = this.axWebBrowser1.Document as HTMLDocument; DHTMLEventHandler Handler = new DHTMLEventHandler (doc); Handler.Handler = new DHTMLEvent (this.Browser_ContextMenuStandardEvent); doc.oncontextmenu = Handler;

Private void browser_contextMenustAndardEvent (mshtml.ihtmleventobj e) {messagebox.show ("Context Menu Action (Event Object) Hooked"; E.RETURNVALUE = false;}

转载请注明原文地址:https://www.9cbs.com/read-7959.html

New Post(0)