retreiving icon associated with a file type without using SHGetFileInfo?
I only know how to do it useing the SHGetFileInfo() API. But that function needs an actual file to exist. I'm wondering if there is a way to get the icon associated with a file without using SHGetFileInfo()???
I know I could create a dummy file and then use it to call SHGetFileInfo() but I rather not do that if there's another way
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!
Re: retreiving icon associated with a file type without using SHGetFileInfo?
Have a look at HKEY_CLASSES_ROOT hive, and notice that each extension is listed there. If you open up a key, look at the (default) value for it.
I'm looking at ".bmp" and the default value for it is "Paint.Picture"
Now in the same hive (HKEY_CLASSES_ROOT) look up "Paint.Picture"
There is a subfolder called "DefaultIcon." The (default) value of this folder will tell you the module name, and icon index, separated by a comma. From here, just call ExtractIcon() on that module, specifying that specfic index.
Re: retreiving icon associated with a file type without using SHGetFileInfo?
aaaaaaah many thanks sounds cool. Umm would you recommend this method though? just curious
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!
Re: retreiving icon associated with a file type without using SHGetFileInfo?
If you use SHGetFileInfo you can use the SHGFI_USEFILEATTRIBUTES attribute if the file doesn't exist.
This way you can extract an icon just be using "*.jpg" as filename.
I wish I could think of something witty to put in my sig...
Re: retreiving icon associated with a file type without using SHGetFileInfo?
aah even more interesting I'll take a look at that....
I'm guessnig that's a constant I need to pass as the dwFileAttribute parameter?
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!
Re: retreiving icon associated with a file type without using SHGetFileInfo?
Originally Posted by MrPolite
aah even more interesting I'll take a look at that....
I'm guessnig that's a constant I need to pass as the dwFileAttribute parameter?
Since I'm feeling generous today, I'll give you the source code for an ActiveX dll I'm using in a program to populate a image list control with file extension icons. It's made in VB6.
Re: retreiving icon associated with a file type without using SHGetFileInfo?
naah I dont want vb6 stuff not even vb.net.... I'm writing in C#. I just ask here cuz I get more responses
I still havent started workign on this part of my app, but will do soon. I like what pax said, and if that didnt work then I'll look at megatran's, and then maybe wossname's
Kaffenils thanks for the reply though, I'll give you a positive feedback as soon as VBF lets me rate people again
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!