vb.netcomocxwmpembedded-control

Suppress messages from embedded Windows Media PLayer


I'm working on a Windows Form Application in which I have embedded a Windows Media Player that lets you play video files. The unique thing is that I have changed the extension of the media files (for reasons which I can't get into here). For instance, "xyz.wmv" might be called "xyz.ext". They play just fine, but before they play, I get the message:

"The file you are attempting to play has an extension that does not match the file format. Playing the file may result in unexpected behaviour. Do you want the Player to try to play the file?"

You can click yes and you can even check the box to not show that message again, but I don't want that for all the obvious reasons including the fact that it confuses users. I have looked into the .settings properties but I cannot find a way to suppress this message and more importantly other messages that might come up.


Solution

  • The .ext (for example) extension is not known to media player, hence the warning.

    What you can do to change this is modify the registry and register this extension. This is described officially here: File Name Extension Registry Settings

    The most simple way to do it is to create a registry key like this:

    HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\Extensions\.ext
    

    And add two key values:

    Runtime (DWORD): 6
    Permissions (DWORD): 15 (or 0xF in hexa)
    

    This is shown here:

    enter image description here