473,408 Members | 2,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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 2128
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_ROOT key.

In C#, you may use Microsoft.Win32.RegistryKey to access the registry, then
loop through all the HKEY_CLASSES_ROOT'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.GetValue to get the (Default) program behavior
associated with ".mp3" file extension.(On my machine, it is "Winamp.File")
2). Find "Winamp.File" sub key also in HKEY_CLASSES_ROOT key.
3). There should be a "DefaultIcon" sub key in "Winamp.File".
4). Then, also use RegistryKey.GetValue method to retrieve the associated
icon address(On my machine, it is "C:\Program Files\Winamp\Winamp.exe,1")

At last, you should P/invoke ExtractAssociatedIcon 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.microsoft.com> wrote in message
news:Fk*************@cpmsftngxa06.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_ROOT key.

In C#, you may use Microsoft.Win32.RegistryKey to access the registry, then loop through all the HKEY_CLASSES_ROOT'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.GetValue to get the (Default) program behavior
associated with ".mp3" file extension.(On my machine, it is "Winamp.File")
2). Find "Winamp.File" sub key also in HKEY_CLASSES_ROOT key.
3). There should be a "DefaultIcon" sub key in "Winamp.File".
4). Then, also use RegistryKey.GetValue method to retrieve the associated
icon address(On my machine, it is "C:\Program Files\Winamp\Winamp.exe,1")

At last, you should P/invoke ExtractAssociatedIcon 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
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...
3
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...
4
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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,...

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.