Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Opening WMV link from IE with custom program

Options
  • 02-11-2007 6:57pm
    #1
    Closed Accounts Posts: 2


    Here's what I'm trying to do: I want the program I'm developing to be the default program for WMV files, whether launched from the hard drive or streamed from a site.

    When activated, my program takes the command line arguments

    Dim param As String = Command()

    And uses that parameter to activate its video player.

    I changed the default action for the WMV file type, for both Open and Play, to: "C:\myprogram.exe" "%1"

    I also went into Windows Media Player and unchecked WMV from the list of file associations.

    This program works fine whenever I double click a WMV on the hard drive, so I know it works. The trouble comes when I click on a link to a WMV file, for example www.mypage.com/video.wmv

    The problem is that when I click on a WMV link, IE downloads the file to a temporary folder, and then runs my program with that.

    What I want it to do is instead pass the link itself as a parameter to my program.

    I've tried changing the file type associations for everything to do with IE to use my program (HTTP, HTTPS, File Transfer Protocol, Gopher Protocol and Internet Shortcut), all to no avail.

    Is there some way I can make IE pass only the link, instead of downloading the entire file?


Comments

  • Registered Users Posts: 1,045 ✭✭✭Bluefrog


    You haven't said what you're programming in but if it's a COM compliant language then the only way I can see of doing what you want is to embed the IE browser control in your app.

    Do a search for "embed web browser control" on Google. The idea would be to write code that would execute on one of the navigate events raised in the control when a user clicks a link. Depending on the content you allow users to surf to you may have to inspect the link to check that it pointed to suitable source for your app and then pass that URL on to your app before cancelling the navigation and returning.

    Browser helpers may be able to do the same kind of thing, don't know, haven't used them personally. If you were using Firefox this would be a lot easier I expect using their extensions API.

    Is this app for personal use or for distribution. Users won't thank you for messing with their file associations. You may also face security and versioning headaches with the browser helper route.

    Hope you made a system restore point before you wreaked havoc on your file associations ;)


  • Registered Users Posts: 2,781 ✭✭✭amen


    you might be able to do this using a MIME type
    google it


  • Moderators, Science, Health & Environment Moderators Posts: 10,079 Mod ✭✭✭✭marco_polo




  • Registered Users Posts: 1,045 ✭✭✭Bluefrog


    I think the intention was not to have IE touch the file at all - as I understood it he merely wants to retrieve the URL. This method definitely is more secure out of the box though - well, as secure as Windows - ehem.


  • Closed Accounts Posts: 2 CMiner


    Exactly. I want my program to, essentially, act exactly like Windows Media Player as far as handling WMV files. Open it from the hard drive, it opens that file. Click on a link in IE, it starts streaming from that web address.

    I neglected to mention that I'm coding in VB.NET (Though willing to switch to something else if there's a solution in that).

    And I did make a backup, and text file copies of the file type info, so everything can be restored after I've mangled it.

    It's in a corporate environment, and I basically have permission to change whatever file types I need to in order for this to work.

    MIME types might be the solution, I've started using my setup program to alter the MIME types my program handles, but I can't seem to find the right type to make streaming files work. IE still insists on downloading the file before opening it, but when I restore Media Player's file associations, IE will let it stream straight from the link.

    MIME types I'm using:

    video/x-ms-asf (.ASX) MS Active streaming format
    video/x-ms-wmv (.WMV) Windows Media Video
    video/x-ms-wvx (.WVX) Microsoft streaming video


  • Advertisement
  • Registered Users Posts: 1,045 ✭✭✭Bluefrog


    I think that what is going on here is that even in windows media player IE is involved in the download. They certainly use a web browser control for their music store.


Advertisement