Icon image

derez

Expert
Licensed User
Longtime User
hi,

Does anybody know how to get the icon of an application as an image (without having it separately as a *.ico file, but directly from the exe file) ?
 

derez

Expert
Licensed User
Longtime User
thanks for the pointer, but it is not what i'm after.

I need something to work within basic4ppc - when I select a program file - to get its icon as an image on a blist item.
 

derez

Expert
Licensed User
Longtime User
Icon Extraction ?

I found this link : CodeProject: Extracting Icons from EXE/DLL and Icon Manipulation. Free source code and programming help

Will it be possible to create a library for icon extraction, or is it possible to use the door library to do it ?

Found this as well:

"The following is an incomplete code fragment for reading icons from a .DLL or .EXE file:

B4X:
// Load the DLL/EXE without executing its code
hLib = LoadLibraryEx( szFileName, NULL, LOAD_LIBRARY_AS_DATAFILE );
// Find the group resource which lists its images
hRsrc = FindResource( hLib, MAKEINTRESOURCE( nId ), RT_GROUP_ICON );
// Load and Lock to get a pointer to a GRPICONDIR
hGlobal = LoadResource( hLib, hRsrc );
lpGrpIconDir = LockResource( hGlobal );
// Using an ID from the group, Find, Load and Lock the RT_ICON
hRsrc = FindResource( hLib, MAKEINTRESOURCE( lpGrpIconDir->idEntries[0].nID ),
                      RT_ICON );
hGlobal = LoadResource( hLib, hRsrc );
lpIconImage = LockResource( hGlobal );
// Here, lpIconImage points to an ICONIMAGE structure
]

Complete code can be found in the Icons.C module of IconPro, in a function named ReadIconFromEXEFile."

it is in this link: Icons in Win32

The application is waiting for the icons....

Thanks
 
Last edited:
Top