Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

Unable to hook onmessage event handler in C# IE10 ,Win8 through Forms Web Browser control and WPF browser too

$
0
0

void_loginBrowser_Navigated(objectsender, WebBrowserNavigatedEventArgse)

        {

vardoc = (sender asSystem.Windows.Forms.WebBrowser).Document;

mshtml.IHTMLWindow3rawWindow= (mshtml.IHTMLWindow3)doc.Window.DomWindow;

rawWindow.attachEvent("onmessage",new DHTMLEventDelegate(MyEventHandler));

}

public delegate void DHTMLEventDelegate(IHTMLEventObj e);

public void MyEventHandler(IHTMLEventObje)
        {
         //this is not firing
          
        }

mshtml.IHTMLWindow3rawWindow= (mshtml.IHTMLWindow3)doc.Window.DomWindow;
// rawWindow.attachEvent("onmessage", OnLoadListener);

rawWindow.attachEvent("onmessage", new DHTMLEventDelegate(this.YourEventHandler));

I don't seem to resolve IHTMLEventObj5(which MSDN says will contain message data) even though I have MSHTML.dll ver10.0  .

Please help me in attaching this event as I need to receive the JSON data through this event only .


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>