How to extract icons from EXE, DLL, or any other source
Posted: Thu Oct 22, 2009 1:34 pm
*** PureBasic version 4.31 Windows XP v5.1 SP3 ***
ExecutablesList = ListIconGadget(#PB_Any, MainWindowLeftOffset, MainWindowTopOffset, MainWindowWidth-2*MainWindowLeftOffset, 225, "", MainWindowWidth-2*MainWindowLeftOffset)
SetGadgetAttribute(ExecutablesList, #PB_ListIcon_DisplayMode, #PB_ListIcon_LargeIcon)
I am currently working on a program launcher of the portable variety. I am populating the above ListIconGadget with user defined executables. Each executable is identified with an icon. Is there an API call or some other method that can be made from within the program to extract the icon (32x32 preferably if exists) from the EXE file (or any other file), or the system default for that file type if the resource is absent from the EXE file. I will offer a manual icon selection for advanced users in the options. Can you offer a PureBasic coding example for this as I am relatively new to PureBasic and haven't written much code in general for quite a while. Thanks in advance.
ExecutablesList = ListIconGadget(#PB_Any, MainWindowLeftOffset, MainWindowTopOffset, MainWindowWidth-2*MainWindowLeftOffset, 225, "", MainWindowWidth-2*MainWindowLeftOffset)
SetGadgetAttribute(ExecutablesList, #PB_ListIcon_DisplayMode, #PB_ListIcon_LargeIcon)
I am currently working on a program launcher of the portable variety. I am populating the above ListIconGadget with user defined executables. Each executable is identified with an icon. Is there an API call or some other method that can be made from within the program to extract the icon (32x32 preferably if exists) from the EXE file (or any other file), or the system default for that file type if the resource is absent from the EXE file. I will offer a manual icon selection for advanced users in the options. Can you offer a PureBasic coding example for this as I am relatively new to PureBasic and haven't written much code in general for quite a while. Thanks in advance.