Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I can make my application associated to a certain file extension and
start the program when i double click any file with that extension
(.ccon or whatever).

BUT,when i double click any file with that extension my application loads without reading from the file that has been opened.

Is there anywhere that my application can see if it was started from the app.exe or a file with right extension?

I just need some pointers where to look not a complete solution to my problem.
I hope this is clear enough.
Posted

1 solution

Look in your Program.cs file: the file names are handed to you via the parameter "args" to the Main function.
 
Share this answer
 
Comments
Per Söderlund 8-Feb-11 4:52am    
there were no parameter there so i added one called string[] args.
Then i opened a file with the right extension.
There it was, the name of the file i just opened the program with, all i had to do was include this in the load event and "Problem solved".
Thank you for the quick and simple response.
OriginalGriff 8-Feb-11 4:59am    
You're welcome!

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