views:

51

answers:

2

It's my guess.

We list a files and directory by Windows Explorer. If Windows Explorer meets a exe file, it does,

LoadLibraryEx(ExefileName, LOAD_LIBRARY_AS_DATAFILE)
Then extracts the icon, and represents it.

But I'm not sure. Is there anyone who knows well about this?

I'm finding a nice case with LOAD_LIBRARY_AS_DATAFILE
Is there anything else you know?

+2  A: 

Hi, there is a win32api called ExtractIconEx.

this is exactly what you are looking for.. :)

http://msdn.microsoft.com/en-us/library/ms648069%28VS.85%29.aspx

clocKwize
ExtractionIconEx doesn't call LOAD_LIBRARY_AS_DATAFILE.It just parses PE image by itself.
Benjamin
@Benjamin: And what are you actually trying to do? The answer is pretty much correct, this is basically what Explorer does.
0xA3
I was under the assumption that explorer also used standard win32 apis.. I could be wrong of course :)
clocKwize
@0xA3 Yes it is. My question was stupid. What I wanted is a nice example using LOAD_LIBRARY_AS_DATAFILE.
Benjamin
@clocKwize It's my fault. You give me a good answer. Thanks!
Benjamin
Necrolis
A: 

Some more detailed info by Raymond Chen:

How the shell converts an icon location into an icon

0xA3