7

I can extract 32*32 icon images, but how about 48*48?

I want to extract an icon image with size 48*48 from a .exe file in Windows. At first, I got the icon resource bits and then I used "CreateIconFromResourceEx" API, but it works true for icon images with size 32*32.

Acorbe
  • 8,367
  • 5
  • 37
  • 66

5 Answers5

3

This link includes usefull code in C++ for extracting icon images of an exe or dll file. but this one dose not work correctly for 48*48 icon image. http://www.codeproject.com/KB/cpp/GetIconsfromExeorDLLs/GetIconsfromExeorDLLs_src.zip

this link realy works true for extrancting icon images in various size frome exe or dll files, but this one is written in C#. we can use it to correct the previous one; http://www.codeproject.com/KB/cs/IconExtractor/IconExtractorApp.zip

0

Use this one for windows: http://www.resedit.net/

aviv
  • 2,719
  • 7
  • 35
  • 48
0

For Windows use the LoadResource and related Win32 API. Just name the 48*48 resource something else.

Brian R. Bondy
  • 339,232
  • 124
  • 596
  • 636
  • An icon may contain multiple images in various size. i want to get the application iocn in right size(48*48) for drawing it on a (DC)device context. I used CreateIconFromResourceEx, but i couldn't get the icon in size 48*48 – Abolhassan Abdolalizadeh Apr 04 '10 at 15:46
  • 1
    @Abolhassan: I understand, and am familiar with the icon file format being a container format, but I'm not sure if there are Win32 API to work with that. You could try adding a new resource which is only a 48x48 icon. – Brian R. Bondy Apr 04 '10 at 18:58
0

You can use code from this perfect answer to list and extract icon size you want: https://stackoverflow.com/a/20731449/1795050

Also, note that actual resource size icon will be created if you call CreateIconFromResourceEx function with zero size and without LR_DEFAULTSIZE flag:

HICON hIcon = CreateIconFromResourceEx( lpData, dwSize, TRUE, 0x00030000, 0, 0, LR_DEFAULTCOLOR);
DJm00n
  • 1,083
  • 5
  • 18
0

Icons, images, music and other materials are saved as resources in the EXE file. Executable files often have the PE standard(Portable Executable). So, simply download a disassembler like "PE Explorer" or "Resource Hacker" to extract what you want from the executables.

Bart
  • 19,692
  • 7
  • 68
  • 77