Get file's associated application / app icon

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm working on a Windows Explorer-like application.

What is the best way to find out what application is set to open a
particular type of file? Is there a function to do this? Do I have to go
through the registry and check ClassesRoot?

Also, once I have the application, I want to be able to get the icon for
that application. How would I get this?
 
Loan Wolf,

Many years ago I wrote an application that lists the associated
applications/icons... & what I did was read the associations in the
registry, which is basic registry usage
 
LoanWolf said:
I'm working on a Windows Explorer-like application.

What is the best way to find out what application is set to open a
particular type of file? Is there a function to do this? Do I have to go
through the registry and check ClassesRoot?

Also, once I have the application, I want to be able to get the icon for
that application. How would I get this?

You can determine a file's icon using 'Icon.ExtractAssociatedIcon' in .NET
2.0. To determine the application associated with a particular file type,
you will have to use p/invoke ('FindExecutable', 'AssocQueryString').

Determining a file's associated application
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=findassociatedapp&lang=en>
 
Again no example code, Herfried

The FindExecutable takes longer to execute & having to keep calling it isn't
a good idea because it just uses processor time & is a slower method
 
Back
Top