Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. mime handling with webbrowser control

mime handling with webbrowser control

Scheduled Pinned Locked Moved C#
question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    abnopanda
    wrote on last edited by
    #1

    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!!:)

    L M 2 Replies Last reply
    0
    • A abnopanda

      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!!:)

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      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) :)

      1 Reply Last reply
      0
      • A abnopanda

        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!!:)

        M Offline
        M Offline
        mitooki
        wrote on last edited by
        #3

        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[^]

        A 1 Reply Last reply
        0
        • M mitooki

          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[^]

          A Offline
          A Offline
          abnopanda
          wrote on last edited by
          #4

          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! :)

          M 1 Reply Last reply
          0
          • A abnopanda

            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! :)

            M Offline
            M Offline
            mitooki
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups