.NET Media Player As Default Player

G Scott
G Scott used Ask the Experts™
I have created a very simple media player.  I can browse from within the app and open files just fine, but I need to set it as the default player for the PC.    I am not even sure how to start that.  I have a feeling it has to do with arguments, but I am lost after that.

I don't really even know how to google that.  The results I did get were only about opening media - which I can already do.

I just need a bit of guidance here.  Thanks for any help you can give me on this.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dante GagliardiDeveloper

If you are asking how a user can register an application as the default for a file type, you can use the Right Click > Open With... and select the checkbox that indicates you wish to use that application for those types of files in the future.

I suspect, however, that the intent of your question was how to allow your application to register itself as the default for certain filetypes. This article from Microsoft should help point you in the right direction. It covers the process of registering an application as the default for desired file types.

This article and this article go over the registry keys you would need to update to register your application as the default for a given file type.

I hope this information helps. Note that some of the information in the first link has been deprecated in Windows 8, but the majority of the information is still current.
Most Valuable Expert 2012
Top Expert 2014
>I have a feeling it has to do with arguments, but I am lost after that.

After you register your app with file types, you need to be able to accept arguments from command line as that's how the file name will be passed to you. In your main form's load event, you need to call the Environment.GetCommandLineArgs method



That's what I was looking for CodeCruiser - the arguments.  Thanks a ton.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial