Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 764
  • Last Modified:

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
0
thready
Asked:
thready
  • 2
1 Solution
 
Alkali_GuyCommented:
ShellExecute
0
 
Alkali_GuyCommented:
You can do:

ShellExecute(NULL, "open", "Foofile.txt", NULL, NULL, SW_SHOW);
0
 
threadyAuthor Commented:
Thank you very kindly!  :-)
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now