I created a qt media player application and have deployed it, now I want to change the properties of songs on my pc to open with it. My question is, what code should I add such that if I double click a song, its played by the media player.
Asked
Active
Viewed 82 times
0
-
The question is not clear. Can you add some more info? Here's what I can understand >> You have created a media player using C++ and now you want to play songs through it – Lalit Mehra Jul 23 '19 at 06:35
-
You may want to read these links: https://learn.microsoft.com/en-us/windows/win32/fileio/reparse-points , https://learn.microsoft.com/en-us/windows/win32/shell/app-registration , https://stackoverflow.com/q/42483387/5910058 – Jesper Juhl Jul 23 '19 at 06:36
2 Answers
0
If you want to be able to play the song with your app when you double click on explorer, you will have to register your app for that mime type.
Easiest way - right click on explorer, "Open with" and choose your app (c:\programs\myapp\myapp.exe
or as a hack, directly from the build dir).
Then - in your main.cpp, look at the command line arguments. Another question to help you: Using QApplication with command line arguments

elcuco
- 8,948
- 9
- 47
- 69
0
You need to set the default open program to your media player.
windows-10-change-default-programs
create-registry-entry-to-associate-file-extension-with-application

Jay_Miao
- 70
- 7