Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

FrigidHelix

How to launch files

This topic is 5839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would like to be able to "launch" files and directories within my application. By "launch", i mean the equivalent of double clicking that file from within explorer and having it open up in its associated application. So far, I have been able to accomplish this solely for directories. I use the CreateProcess() function to spawn a new process of "explorer.exe", passing it the directory path as its command line. I would like a more general solution that works for all file types. I think there is a function that does this; I remember having seen something in code for an "About box" that launched a URL in the default browser, using a simple function call, the name of which escapes me. Any advice would be greatly appreciated. I am really interested in an EASY way of doing this, so don''t tell me to find a file''s association from the registry, and then spawn a process for that application, and open the file with it -- I am already aware of this technique, and am looking for a cleaner method.

Share this post


Link to post
Share on other sites
Advertisement
Look up ShellExecute on MSDN.

/*=========================================*/
/* Chem0sh */
/* Lead Software Engineer & Tech Support */
/* http://www.eFaces.biz */
/*=========================================*/

Share this post


Link to post
Share on other sites
Execellent! That is exactly what I was looking for.

Oddly, I had searched for "execute" on MSDN, but the search results turned up a load of garbage. I have to learn how to search better on the website...

thanx

Share this post


Link to post
Share on other sites
No prob. I ran into this same problem not too long ago.

Glad to be of service!

/*=========================================*/
/* Chem0sh */
/* Lead Software Engineer & Tech Support */
/* http://www.eFaces.biz */
/*=========================================*/

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!