473,465 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Get file's associated application / app icon

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?
Apr 27 '07 #1
5 6659
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

--
Newbie Coder
(It's just a name)

"LoanWolf" <Lo******@discussions.microsoft.comwrote in message
news:89**********************************@microsof t.com...
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?

Apr 28 '07 #2
"LoanWolf" <Lo******@discussions.microsoft.comschrieb:
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>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 28 '07 #3
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

--
Newbie Coder
(It's just a name)

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
"LoanWolf" <Lo******@discussions.microsoft.comschrieb:
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>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 2 '07 #4
LoanWolf,

Here is VB 7 code which can be easily adapted to get all icons from the
registry instead of a single file:

http://www.planet-source-code.com/vb...1162&lngWId=10

--
Newbie Coder
(It's just a name)

"Newbie Coder" <ne*********@spammeplease.comwrote in message
news:Op**************@TK2MSFTNGP06.phx.gbl...
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

--
Newbie Coder
(It's just a name)

"LoanWolf" <Lo******@discussions.microsoft.comwrote in message
news:89**********************************@microsof t.com...
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?


May 2 '07 #5
LoanWolf,

http://support.microsoft.com/kb/319340/

--
Newbie Coder
(It's just a name)
"Newbie Coder" <ne*********@spammeplease.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
LoanWolf,

Here is VB 7 code which can be easily adapted to get all icons from the
registry instead of a single file:

http://www.planet-source-code.com/vb...1162&lngWId=10
>
--
Newbie Coder
(It's just a name)

"Newbie Coder" <ne*********@spammeplease.comwrote in message
news:Op**************@TK2MSFTNGP06.phx.gbl...
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

--
Newbie Coder
(It's just a name)

"LoanWolf" <Lo******@discussions.microsoft.comwrote in message
news:89**********************************@microsof t.com...
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?


May 6 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tim Jarman | last post by:
Apologies in advance for the long post - I wanted to be sure I included all the relevant details. The answer is probably very, very simple. I am doing something stupid here, but I don't know what...
3
by: Sam | last post by:
I've been googling for a couple of hours now and tried some different things, but I've been unable to get the icon for a distributed access application to do anything but display the default...
3
by: Wayne | last post by:
I currently have an app whose Icon I am setting. I want to set the icons in my forms at run time to that of the application icon. How do I retrieve the application Icon so that I can use it for my...
6
by: Paul | last post by:
In other development environments i've used the IDE had facilities to create custom icons for the application and files it created. It would be nice to have a custom icon for a created file, but...
3
by: QLD_AU | last post by:
Is their a way in a VB.Net application to set all sub form icons to the main form ? or even set all icons to the Application icon, without having to reference the icon as a filename ? With...
1
by: quest | last post by:
I created windows application using C#. I tried to replace the default application icon by replacing the app.ico file in the project directory but the application still load the old icon. Can...
4
by: randy1200 | last post by:
I have a Windows application that previously had the company logo "MyCompany.ico" added to the upper left-most corner. The company has since issued a new version of "MyCompany.ico" that looks...
1
by: Avnish | last post by:
Hi, I have created an form based application in c# having some GUI. I have also added localization support to it due to GUI changes for different customers.Now the issue I have the Application...
5
by: =?Utf-8?B?Um9i?= | last post by:
Hi all, I want to fire the drag events when someone drags a file over the application's icon. This means the application has not opened yet. Scenario would be: 1. user selects file they want...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.