Tokfrans
Tokfrans

Reputation: 1959

Make my program the "Choose Default Program" when opening a file

I'm making a music player. And what I basically want to know is how to make your program open a file which was clicked by the user in explorer.

For instance:

I've set my music player to the deafult program for opening .mp3's. And when I double click a .mp3 file in my music folder, I want my program to open and start playing that song.

But how does that work?

Thanks in advance!

Upvotes: 1

Views: 598

Answers (1)

Reed Copsey
Reed Copsey

Reputation: 564403

This is handled via the registry. You can see details of the (many) registry keys and values required to properly setup a file association here.

That being said, the best way to handle this is typically via your installation. Windows Installer supports the RegisterExtensionInfo extension, which will properly setup the registry for you during your program's installation.

Upvotes: 5

Related Questions