Finding default file type application path 
Author Message
 Finding default file type application path

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?



Wed, 29 Dec 2004 07:49:59 GMT  
 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?



Wed, 29 Dec 2004 09:50:17 GMT  
 Finding default file type application path
Thanks, Ken. That works great!

Rich

Quote:
>-----Original Message-----
>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
Quote:
>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
Quote:

>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
Quote:

>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?

>.



Sat, 01 Jan 2005 03:55:22 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. opening a file with the default app for that file type

2. Find the file path of a program file

3. Finding Application path of VB .Net project

4. Finding the application path

5. Finding application path

6. Find path to application

7. How to Find Installed Application Path

8. Setting / finding path to an Application

9. Finding the path to the application

10. Finding an application's executable name and path

11. Make "My Computer" default file path

12. Change excel default file path problem

 

 
Powered by phpBB® Forum Software