Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

developing a file explorer

Posted on 1998-01-28
5
Medium Priority
?
324 Views
Last Modified: 2013-12-03
While developing an file explorer I have problems extracting the smallicon of the associated executable file.

The large on wasn't difficult: You only have to use the api call EXTRACTASSOCIATEDICON and you will get an iconhandle. The system metrics define the size of the returned icon. This ist 32x32 with normal screen resolution.

Thanks

Marc
0
Comment
Question by:M_Hoeper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 7

Expert Comment

by:galkin
ID: 1410525
You cannot do this with ExtratAssociatedIcon. You must use LoadImage instaed specifying LR_LOADFROMFILE, IMAGE_ICON
 and cxDesired and cxDesired as 16.
0
 

Author Comment

by:M_Hoeper
ID: 1410526
I can get the icon index in the associated executable from the EXTRACTASSOCIATEDICON (doesn't work??) or from the registry.

But I hadn't success using LoadImage with this information. I didn't find any routine of the Windows nt api which allows me to use the icon index found in the registry.
0
 
LVL 7

Accepted Solution

by:
galkin earned 600 total points
ID: 1410527
ExtratAssociatedIcon allows you to extract only default icon. To extract icon you want use ExtractIconEx, this function allows you to extract both small and large icons of any icon index. what ExtratAssociatedIcon does is it looks up in registry according to the file extension, finds default icon index and target icon file and then loads icon. The problem is it loads icon of default size. If you want to load both small and large icon you must do the following. First extract file etension. Say you have file document.doc file extension is ".doc" Look into registry under HKEY_CLASSES_ROOT\.doc. Read this key default value. On my computer it is "Word.Document.6". Now look the key HKEY_CLASSES_ROOT\Word.Document.6. It has subkey "DefaultIcon" which default value is full path to the file containing the icon foolowed by icon idex separated by comma. You can read this infornation and knowing file and icon index extract both large and small icon with ExtractIconEx.
0
 

Author Comment

by:M_Hoeper
ID: 1410528
Thank you! My help system kept back this information. I wrote a small sample and it works very good.

But: Why doesn't EXTRACTASSOCIATEDICON return the associated exe file and its index?

In another expert area they recommend to use SHGetFileInfo. My help system remarks, that this routine only runs on Windows 95 os. I tried and learned that it works with win nt 4, too...?

Do you send me the help for the ExtractIconEx routine? E.g. what is the meaning of the last parameter?

Thanks a lot

Marc (m.hoeper@tu-bs.de)
0
 

Author Comment

by:M_Hoeper
ID: 1410529
Thank you! My help system kept back this information. I wrote a small sample and it works very good.

But: Why doesn't EXTRACTASSOCIATEDICON return the associated exe file and its index?

In another expert area they recommend to use SHGetFileInfo. My help system remarks, that this routine only runs on Windows 95 os. I tried and learned that it works with win nt 4, too...?

Do you send me the help for the ExtractIconEx routine? E.g. what is the meaning of the last parameter?

Thanks a lot

Marc (m.hoeper@tu-bs.de)
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question