mime handling with webbrowser control
-
is there any way to intercept and control what to do based on the Content-Type of the page with the WebBrowser control? I am trying to capture and save the asx file instead of automatically opening and playing in media player. I have tried to intercept it on DownloadComplete, Navigating, Navigated events and none of them worked. :doh: Any suggestions is welcome!!:)
-
is there any way to intercept and control what to do based on the Content-Type of the page with the WebBrowser control? I am trying to capture and save the asx file instead of automatically opening and playing in media player. I have tried to intercept it on DownloadComplete, Navigating, Navigated events and none of them worked. :doh: Any suggestions is welcome!!:)
Intercept the click and use WebRequest rather. Else if the browser control has some kind of 'redirection' event (HTTP 302 i think) that could work. xacc.ide-0.1.1.10 - now with AutoComplete(kinda) :)
-
is there any way to intercept and control what to do based on the Content-Type of the page with the WebBrowser control? I am trying to capture and save the asx file instead of automatically opening and playing in media player. I have tried to intercept it on DownloadComplete, Navigating, Navigated events and none of them worked. :doh: Any suggestions is welcome!!:)
-
Applications that host the WebBrowser Control can enable MIME handling programmatically by using the CoInternetSetFeatureEnabled function. See: http://msdn.net/library/default.asp?url=/workshop/author/dhtml/overview/xpsp2compat.asp[^]
Are there any examples out there that I can take a look at the usage of this function? I tried using the function and it resulted in build errors. Also, does this function allow me to put in my own code to handle the content for a specific content-type? I got a bit confused reading the doc. Thanks for the help! :)
-
Are there any examples out there that I can take a look at the usage of this function? I tried using the function and it resulted in build errors. Also, does this function allow me to put in my own code to handle the content for a specific content-type? I got a bit confused reading the doc. Thanks for the help! :)
Reading it again, setting FEATURE_MIME_HANDLING in the registry will only activate Microsoft's additional MIME checking they introduced in SP2 for your application, sorry. :sigh: I think to actually handle a particular MIME type at runtime you might need something like http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/pluggable/reference/ifaces/iinternetsession/registermimefilter.asp[^], though I don't know enough about it at this stage to give you an example. This is something I might need to use in the coming months so if you make any progress it would interesting to hear how you get on. :) mitooki