I made a small video player and I want my video player to be the default program for opening video files.
Does the video file's name become the argument(char** argv) to my program? (Windows)
I made a small video player and I want my video player to be the default program for opening video files.
Does the video file's name become the argument(char** argv) to my program? (Windows)
You would have to modify the registry to have it open with your program. You can do this yourself on your own machine you will need to create an installer program of some sort to do it on other people's machines (and in most cases may need to run the installer as admin to write to the correct registry locations.). When you create the registry entries you can set what arguments it will send to your program, I think the default setup if you just right click, open with your program would be the same as calling "C:\full\path\to\myprogram.exe C;\full\path\to\video.mpg" or whatever the case may be from the console (dos) window.
http://msdn.microsoft.com/en-us/library/windows/desktop/cc144154(v=vs.85).aspx
Right click on a video file, hover over open with, choose your programs execution file, and check "Make this your default program". No need for registry editing :)!
Does the video file's name become the argument(char** argv) to my program? (Windows)If you compiled as a console program then your main function's prototype should be something like:
Create a batch file and write code like this
@echo off
assoc .mpeg=YourVPlayer
assoc .mp4=YourVPlayer
assoc .mp3=YourVPlayer
assoc .wav=YourVPlayer
[Write all the extensions that your software supports
type YourVPlayer=[Your software exe file path]
save as anyname.bat
You can use in you vedio player setup file or SFX file and run it automatically after installation
I think usefull.
Arun Haridas