open a program with associated file programmatically

Hi Experts,

When in windows exlorer, double clicking on any file opens up the associated program by its extension.  Is there a windows API call that I can use that just takes a full path to a file to open up the correct program for me with the file?

Thanks!
Mike
LVL 1
threadyAsked:
Who is Participating?
 
Alkali_GuyConnect With a Mentor Commented:
You can do:

ShellExecute(NULL, "open", "Foofile.txt", NULL, NULL, SW_SHOW);
0
 
Alkali_GuyCommented:
ShellExecute
0
 
threadyAuthor Commented:
Thank you very kindly!  :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.