Please see my comment to the question, and familiarize yourself with such elementary topic as "
file association":
http://en.wikipedia.org/wiki/File_association[
^].
Then, do some Web search on the topic, entering your language, platform, frameworks or libraries you use or other relevant information. If, after such basic research, you still have some difficulties, provide this information by tagging your question with appropriate keywords, explain what are those difficulties. That could help you to get more specific direction and advice.
—SA