473,796 Members | 2,839 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 2176
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
9673
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
10452
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
10221
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10169
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5440
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...
0
5569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
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
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.