Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

ICON Resources - extraction

isn-removed200637
1,088 Views
Is there a way to extract icon resources from DLL's such as SHELL32.DLL (and any other executable) so that I can paste and edit them using the Visual Studio Resource editor?
0 Kudos
9 Replies
Steven_L_Intel1
Employee
1,088 Views
Go to www.download.com and search for "icon extract".

Steve
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,088 Views
I use the following hack (it is useful also for toolbar buttons, splash screens, etc.):

1) In Tools/File types/Advanced/Change icon... dialog, select the DLL from
you want the icon(s) extracted (e.g. for toolbar buttons, just run the application you want to "hack")
2) Press a PrintScreen or Alt+PrintScreen, grabbing the screen
3) Open a blank picture in Paint, and paste the screen shot
4) Select & copy the region of interest and paste it into VS resource editor.

Also, there are freeware/shareware utilities (I have "Resource-grabber") which are able to dump all resources from an exe/dll into a folder, exporting resources in the right format (.ico, .cur, .bmp).

Jugoslav
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,088 Views
I use the following hack (it is useful also for toolbar buttons, splash screens, etc.):

1) In Tools/File types/Advanced/Change icon... dialog, select the DLL from
you want the icon(s) extracted (e.g. for toolbar buttons, just run the application you want to "hack")
2) Press a PrintScreen or Alt+PrintScreen, grabbing the screen
3) Open a blank picture in Paint, and paste the screen shot
4) Select & copy the region of interest and paste it into VS resource editor.

Also, there are freeware/shareware utilities (I have "Resource-grabber") which are able to dump all resources from an exe/dll into a folder, exporting resources in the right format (.ico, .cur, .bmp).

Jugoslav
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,088 Views
Double post is not my fault -- I hit "Edit" button after I had realized that the numbered paragraphs will get screwed. Instead, the fixed version also got screwed and the first one appeared anyway. I think I'll revert to "Back" in my browser.

Jugoslav
0 Kudos
isn-removed200637
1,088 Views
Thanks Steve and Jugoslav for your help. 'Resource grabber' looks pretty good and the evaluation version ran ok on my Win NT system. If I can find a way of getting the payment in $US cash from here in the UK to the shareware vendor, I will be in business. I remain curious as to how to recognise icon data in a binary file - I have run DUMPBIN on SHELL32.DLL to get a list of members and it gives .rsrc as a member (along with its starting address), which I guess is where the resources are held. If I want to extract the resources myself, I need to know how the icon data is stored (disguised?)- where it begins and where it ends- so that I can recognise it. Any suggestions?
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,088 Views
It's not necessary to use such low-level hacks as parsing the executable and extracting resources -- there are Win32 APIs which let you do that. Take a look, for example, at EnumResources, EnumResourceTypes, then FindResource, LoadResource, LockResource Win32 functions. With dlls, it's
piece of cake (since they can be loaded directly into "grabber's" address space using LoadLibrary). However, it seems that the Resource-grabber and MS's ExeView use just the technique you described -- "parse" the executable and extract the resources. See for example

http://support.microsoft.com/support/kb/articles/Q81/3/36.ASP

http://support.microsoft.com/support/kb/articles/Q70/0/73.ASP

Regards
Jugoslav
0 Kudos
isn-removed200637
1,088 Views
Thanks again, Jugoslav. Your pointer to EXEVIEW was welcome until I discovered that the download was a self-extracting file which yielded uncompiled C-code which I cannot use and which requires access to windows.h, commdlg.h and memory.h, none of which I have. Nice try.
0 Kudos
Intel_C_Intel
Employee
1,088 Views
Maybe I missed the idea, but why not just use File | Open and navigate to the c:winntsystem32 folder (or whatever) and choose shell32.dll (or some other file with resources) and in the 'Open as' dropdown select Resources (and feel free to choose 'Open as read-only' if you like). Then select an icon, copy it, and paste it into your project's resource script. It works for me (and it's easier to do than to explain!)

So, did I miss something, or is this OK?

-John
0 Kudos
isn-removed200637
1,088 Views
Many thanks, John, for pointing me to this capability that MS Dev Studio has
that I was unaware of. I opened SHELL32.DLL as 'resources' and all of its
resources were displayed in the resource panel.
0 Kudos
Reply