Solved

open a program with associated file programmatically

Posted on 2006-11-28
3
759 Views
Last Modified: 2013-11-20
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
Comment
Question by:thready
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Expert Comment

by:Alkali_Guy
ID: 18032273
ShellExecute
0
 
LVL 5

Accepted Solution

by:
Alkali_Guy earned 500 total points
ID: 18032303
You can do:

ShellExecute(NULL, "open", "Foofile.txt", NULL, NULL, SW_SHOW);
0
 
LVL 1

Author Comment

by:thready
ID: 18032340
Thank you very kindly!  :-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question