
Finding default file type application path
Use ShellExecute.. it will launch the default application of any file you
pass to it... based on the extension. That way, you won't be attempting to
open the file using a specific application.. in case the user chose to...
for example, associate *.txt with Microsoft Word. ShellExecute takes care of
the grunt work.
Here's a quicky sample that shows how to go about...
Adding Hyperlink Functionality Using the Label Control
http://www.mvps.org/vbnet/index.html?code/intrinsic/sehyperlink.htm
Here's one that shows off some of the API's power
ShellExecute Madness
http://www.mvps.org/vbnet/index.html?code/shell/shellexecute.htm
See the "Related" links for more info..
--
Ken Halter - MS-MVP-VB - Please keep it in the groups..
http://www.vbsight.com/ - http://www.vbsight.com/MultiColumn.htm
Quote:
> I need to launch a file viewer application from a VB6 app.
> I can use the Shell function to do it it I know the
> application's path. I would like to be able to determine
> the default application path from the registry, based on
> the system default file type assignments.
> For instance, if I want to view a PDF file, I want to
> launch AcroRd32. Rather than rely on it being on a
> particular, known path, I want to find out form the
> registry what the default command path is for files of
> type ".pdf". I can find the info in the registry using
> REGEDIT, but I can't find a way to access if from VB.
> GetSettings can't seem to locate it.
> Any suggestions?