views:

159

answers:

2

I'm getting the following from a third party library (one example):

@%SystemRoot%\SomePath\SomeFile.Dll,-203

I know from context that this is an icon. My question is, how would I take these "addresses" and actually pull out the data?

On a related note, I'd also like to know the best way to pull the displayed (from the shell) icon out of a vanilla EXE.

I'm working in C#, but I can work with C or C++ examples just as well.

A: 

If you use reflector you can see exactly where the things are stored. (If its a compatable dll). It's helped me in the past get to emedded resources.

DeletedAccount
+2  A: 

With an EXE, you should call the SHGetFileInfo API function and indicate that you want the icon. This function will check all the different ways that an icon can be provided (in the file, through shell extensions, etc, etc).

For what you are getting from the third party library, you can call the ExtractIconEx API function passing the name of the file (the first part) and the index (the second part).

casperOne