Get Associated icons for a file extension

  • Thread starter Thread starter Shane Story
  • Start date Start date
S

Shane Story

I want to be able to get the icon associated with a certain file extension.

I can read the registry hkey_classes to get the ext. then look to the other
key for default icon.

How can I then extract the icon in file x at index 1 or whatever?

Again, I am not dealing with a file exactly but with a string path of the
file that has an extension.

I want to be able to take .pdf and get it's icon just by know .pdf, or .exe
or whatever.

Thanks,

Shane
 
I want to be able to get the icon associated with a certain file extension.

I can read the registry hkey_classes to get the ext. then look to the other
key for default icon.

How can I then extract the icon in file x at index 1 or whatever?

Again, I am not dealing with a file exactly but with a string path of the
file that has an extension.

I want to be able to take .pdf and get it's icon just by know .pdf, or .exe
or whatever.

Thanks,

Shane

ExtractIcon or ExtractIconEx come to mind.
 
I want to be able to get the icon associated with a certain file extension.

I can read the registry hkey_classes to get the ext. then look to the other
key for default icon.

How can I then extract the icon in file x at index 1 or whatever?

Again, I am not dealing with a file exactly but with a string path of the
file that has an extension.

I want to be able to take .pdf and get it's icon just by know .pdf, or .exe
or whatever.

Thanks,

Shane
Better yet - just remembered...

ExtractAssocitatedIcon
 
Dang ?,

Forgive me and no offense meant, but you sound like a 1930's gold prospector
from the frozen Yukon wastelands

' dag nabbit! '

;-)

Regards - OHM#




Tom said:
Dang! I didn't know that one....

Regards - OHM# (e-mail address removed)
 
Dang! I didn't know that one....

I'm not sure it's worth knowing about, the code isn't very good
anyway. Doesn't compile with Option Strict On, and the SHFILEINFO
struct is incorrect (missing the StructLayout attribute for auto
charset).



Mattias
 
for anyone looking, the answer to this is found in an article on 1-14-04
between SStory and Ken Tucker
entitled... !Help with API call from vb. Must be trampling memory or
something!

The answer is to take Ken's class and use the flags that were in my original
function to get it just via exesion.

ie. for a .exe file pass ".exe" and get the right icon.

Shane
 
Back
Top