Opening files in the appropriate program in c++ and windows

Started by
4 comments, last by flangazor 19 years, 5 months ago
i am writing a program which will have a file browsing capability added to it. I would like the user to be able to double click on a file and it automatically open in the correct program (sortof a preview file feature) i would not like to use windows explorer in a child window, or wnything like that (Explorer is giving me enough trouble as it is). Does anyone know how i would do this? links would be nice, but i searched for it on google and couldn't find anything (maybe i searched for the wrong thing). Anyway, i'd like to find out how to do this, but i have no idea exactly how it is done. Does it read the value from the registry to determine the proper program to run? Anyway, thats the only idea i have. thanks in advance personwholives

Stupid details.....always get in the way....it's time to write the dwim(x) function ("do what i mean to")
Advertisement
Call ShellExecute() on the file in question, with the action being "open".
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
You might want to try using the ShellExecute function.
thanks, i probably never would have found that.

personwholives

Stupid details.....always get in the way....it's time to write the dwim(x) function ("do what i mean to")
Quote:Original post by personwholives
thanks, i probably never would have found that.

personwholives


Then you should probably be pointed to The MSDN. The Library link at the top of the page "is an essential resource for developers using Microsoft tools, products, and technologies. It contains a bounty of technical programming information, including sample code, documentation, technical articles, and reference guides" (http://msdn.microsoft.com/library/default.asp).
I answered this a month ago citing 'system(...)'.

Perhaps it's a faqable question.

This topic is closed to new replies.

Advertisement