473,323 Members | 1,570 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,323 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 2125
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.