473,804 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FolderOptions > FileTypes > Icons

I'm trying to get a list of all file icons registered to file extensions
located on the machine. I would like to beable to loop through all icons
and save the images in a seperate directory named after the extension they
are mapped to. Should be no problem but I can't seem to find any
information on finding a way to get a list of icons and extensions
registered on the system.
Thanks,
Ron
Nov 16 '05 #1
3 2177
Hi Ron,

Based on my understanding, you want to get all the registed file extensions
in Windows system, then you want to get the associated icons of these file
extension.

=============== =============== ==
Actually, all the registed file extensions are stored in registry. They are
stored as the sub keys of HKEY_CLASSES_RO OT key.

In C#, you may use Microsoft.Win32 .RegistryKey to access the registry, then
loop through all the HKEY_CLASSES_RO OT's sub keys, that is started with
"."(such as .bmp, .avi etc)

I also want to inform you that, the icon is not associated with certain
file extension. Each file extension has default open program(For details,
it also associates with certain behavior). And the icon is associated with
the open program and behavior. So you should first find the default open
behavior of the file extension, then find the associated icon.

Take .mp3 file for example:
1). Use RegistryKey.Get Value to get the (Default) program behavior
associated with ".mp3" file extension.(On my machine, it is "Winamp.Fil e")
2). Find "Winamp.Fil e" sub key also in HKEY_CLASSES_RO OT key.
3). There should be a "DefaultIco n" sub key in "Winamp.Fil e".
4). Then, also use RegistryKey.Get Value method to retrieve the associated
icon address(On my machine, it is "C:\Program Files\Winamp\Wi namp.exe,1")

At last, you should P/invoke ExtractAssociat edIcon Win32 API to retrieve
the associated icon.

=============== =============== ==
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #2
Excellent! haven't tried it but sounds like it will work

Ron

""Jeffrey Tan[MSFT]"" <v-*****@online.mi crosoft.com> wrote in message
news:Fk******** *****@cpmsftngx a06.phx.gbl...
Hi Ron,

Based on my understanding, you want to get all the registed file extensions in Windows system, then you want to get the associated icons of these file
extension.

=============== =============== ==
Actually, all the registed file extensions are stored in registry. They are stored as the sub keys of HKEY_CLASSES_RO OT key.

In C#, you may use Microsoft.Win32 .RegistryKey to access the registry, then loop through all the HKEY_CLASSES_RO OT's sub keys, that is started with
"."(such as .bmp, .avi etc)

I also want to inform you that, the icon is not associated with certain
file extension. Each file extension has default open program(For details,
it also associates with certain behavior). And the icon is associated with
the open program and behavior. So you should first find the default open
behavior of the file extension, then find the associated icon.

Take .mp3 file for example:
1). Use RegistryKey.Get Value to get the (Default) program behavior
associated with ".mp3" file extension.(On my machine, it is "Winamp.Fil e")
2). Find "Winamp.Fil e" sub key also in HKEY_CLASSES_RO OT key.
3). There should be a "DefaultIco n" sub key in "Winamp.Fil e".
4). Then, also use RegistryKey.Get Value method to retrieve the associated
icon address(On my machine, it is "C:\Program Files\Winamp\Wi namp.exe,1")

At last, you should P/invoke ExtractAssociat edIcon Win32 API to retrieve
the associated icon.

=============== =============== ==
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #3
Hi Ron,

Thanks for your feedback. I am glad my reply makes sense to you.

If you meet some further problem, please feel free to post, I will help
you. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #4

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

Similar topics

1
1842
by: Jakob Bengtsson | last post by:
Hi, Does anyone know how to get the icons for all filetypes installed on the system? I can extract the associated icon from a file, but I don't know how to: 1) Get a list of filetypes; 2) Get the associated icon for those filetypes. Thanks for any help,
3
387
by: Ron Vecchi | last post by:
I'm trying to get a list of all file icons registered to file extensions located on the machine. I would like to beable to loop through all icons and save the images in a seperate directory named after the extension they are mapped to. Should be no problem but I can't seem to find any information on finding a way to get a list of icons and extensions registered on the system. Thanks,
4
327
by: Ron Vecchi | last post by:
I'm trying to get a list of all file icons registered to file extensions located on the machine. I would like to beable to loop through all icons and save the images in a seperate directory named after the extension they are mapped to. Should be no problem but I can't seem to find any information on finding a way to get a list of icons and extensions registered on the system. Thanks,
1
253
by: Jakob Bengtsson | last post by:
Hi, Does anyone know how to get the icons for all filetypes installed on the system? I can extract the associated icon from a file, but I don't know how to: 1) Get a list of filetypes; 2) Get the associated icon for those filetypes. Thanks for any help,
0
9711
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9591
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10594
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9166
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7631
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4306
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 we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.