[python-win32] Extract icon from exe files

Mark Hammond skippy.hammond at gmail.com
Wed Apr 22 06:35:09 CEST 2009


EISEN Nicolas wrote:
> Hi,
> 
> After search, I found many function to get Handler from exe (or dll) 
> file icons . But I don’t understand how use the Handler …
> 
> For example:
> 
> />>> Import win32gui
>> >> i= win32gui.ExtractIcon(0,'e:\\dxdiag.exe',0)
>> >> icon = win32gui.LoadIcon ( i , 0)/
> 
> 
> Or with ExtractIconEx to get a list of all icons, I’m always with many 
> Handlers without knowing how to save or write it in file.
> 
> The finality is to extract the exe file icon, and next, save the picture 
> on the disk.

Check out the win32\Demos directory, particularly win32gui_menu.py which 
converts an icon to a bitmap (although probably not very well!)

Mark


More information about the python-win32 mailing list