Click here to Skip to main content
15,884,838 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I am making a video player. Now I can play a video. But I would like that when I click a video file, it can be played in my player. What should I do? I guess I need to change register. I'd like to know how to change it and how to change it by C# code.
Thank you.
Posted

You need a file association between your application and the file type of the videos. See e.g. http://stackoverflow.com/questions/1556853/associating-file-extensions-with-a-program[^] or File Association in VB.NET[^]
 
Share this answer
 
First you need File Association for the Extension.
After you associate the file, WIndows will call your program EXE and send the file name as a command line argument, You need to read the argument, and play the file.
 
Share this answer
 
You have to extend/customize the shell context menu.

Here is a good starting point: Use Shell ContextMenu in your applications[^]
 
Share this answer
 
Comments
johannesnestler 23-Jun-14 10:54am    
no - he hust needs a file type association for relevant media file extensions, no need for a Shell Extension (could be useful but OP didn't ask for it)
C#
Application.Run(new ConstructorOfApp());


Hope this will do the work.
 
Share this answer
 
Comments
johannesnestler 24-Jun-14 12:28pm    
???

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900