?
Solved

open a program with associated file programmatically

Posted on 2006-11-28
3
Medium Priority
?
761 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 2000 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

777 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